Compare commits
No commits in common. "8cd6f8eb17f41cef0bb99055672b59d7dede722b" and "15b1aaf83b4bc7ecd15e80a01328c6a575c43b49" have entirely different histories.
8cd6f8eb17
...
15b1aaf83b
2 changed files with 4 additions and 3 deletions
|
@ -31,8 +31,6 @@ public class HttpResponse
|
|||
|
||||
public static HttpResponse BadRequest(HttpContent? content = null) => new HttpResponse(400, "Bad request", content);
|
||||
|
||||
public static HttpResponse Forbidden(HttpContent? content = null) => new HttpResponse(403, "Forbidden", content);
|
||||
|
||||
public static HttpResponse NotFound(HttpContent? content = null) => new HttpResponse(404, "Not found", content);
|
||||
|
||||
public static HttpResponse NotAcceptable(HttpContent? content = null) => new HttpResponse(406, "Not acceptable", content);
|
||||
|
|
|
@ -90,7 +90,10 @@ class MIMETypeConverter : JsonConverter<MIMEType>
|
|||
|
||||
public override MIMEType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
string? str = reader.GetString() ?? throw new JsonException("Cannot read MIME type");
|
||||
string? str = reader.GetString();
|
||||
if (str == null)
|
||||
throw new JsonException("Cannot read MIME type");
|
||||
|
||||
return new MIMEType(str);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue