From 072578b5ff7918f7a55250dd9fd3e61bead6d0a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=99=E7=A9=8F=E9=9D=84?= <170472707+seionmoya@users.noreply.github.com> Date: Wed, 25 Sep 2024 02:58:05 +0200 Subject: [PATCH] Fix SendJsonAsync method --- Fuyu.Common/Networking/HttpContext.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Fuyu.Common/Networking/HttpContext.cs b/Fuyu.Common/Networking/HttpContext.cs index 8324d77..64bcb38 100644 --- a/Fuyu.Common/Networking/HttpContext.cs +++ b/Fuyu.Common/Networking/HttpContext.cs @@ -82,7 +82,11 @@ public async Task SendStatus(HttpStatusCode status) public async Task SendJsonAsync(string text, bool zipped = true) { var encoded = Encoding.UTF8.GetBytes(text); - await SendAsync(encoded, "application/json; charset=utf-8", HttpStatusCode.Accepted, zipped); + var mime = zipped + ? "application/octet-stream" + : "application/json; charset=utf-8"; + + await SendAsync(encoded, mime, HttpStatusCode.Accepted, zipped); } public void Close()