Additional fixes for 3.0

This commit is contained in:
nicolas.dorier
2019-10-09 17:06:00 +09:00
parent c5ba063edf
commit 8643c04a39
7 changed files with 11 additions and 6 deletions

View File

@@ -47,7 +47,11 @@ namespace BTCPayServer.Models
}
context.HttpContext.Response.Headers.Add("Content-Type", new Microsoft.Extensions.Primitives.StringValues("application/json"));
var str = JsonConvert.SerializeObject(jobj);
#if NETCOREAPP21
using (var writer = new StreamWriter(context.HttpContext.Response.Body, new UTF8Encoding(false), 1024 * 10, true))
#else
await using (var writer = new StreamWriter(context.HttpContext.Response.Body, new UTF8Encoding(false), 1024 * 10, true))
#endif
{
await writer.WriteAsync(str);
}