fix(api): send proper content-type header for errors
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
@@ -37,6 +39,13 @@ public static class APIJsonExt
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
public static async Task WriteJSON(this HttpResponse resp, int statusCode, string jsonText)
|
||||
{
|
||||
resp.StatusCode = statusCode;
|
||||
resp.Headers.Add("content-type", "application/json");
|
||||
await resp.WriteAsync(jsonText);
|
||||
}
|
||||
}
|
||||
|
||||
public struct FrontersReturnNew
|
||||
|
||||
Reference in New Issue
Block a user