mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-18 04:34:21 +01:00
Remove BOM + add content-type if there is an error
This commit is contained in:
@@ -92,8 +92,9 @@ namespace BTCPayServer.Hosting
|
||||
private static async Task HandleBitpayHttpException(HttpContext httpContext, BitpayHttpException ex)
|
||||
{
|
||||
httpContext.Response.StatusCode = ex.StatusCode;
|
||||
using(var writer = new StreamWriter(httpContext.Response.Body, Encoding.UTF8, 1024, true))
|
||||
using(var writer = new StreamWriter(httpContext.Response.Body, new UTF8Encoding(false), 1024, true))
|
||||
{
|
||||
httpContext.Response.ContentType = "application/json";
|
||||
var result = JsonConvert.SerializeObject(new BitpayErrorsModel(ex));
|
||||
writer.Write(result);
|
||||
await writer.FlushAsync();
|
||||
|
||||
Reference in New Issue
Block a user