From cd414302bf4819f50e9e37ca1b76bac7c6ee359a Mon Sep 17 00:00:00 2001 From: CWX Date: Tue, 21 Jan 2025 13:09:17 +0000 Subject: [PATCH] Fix debugging response with requestcompressed and responsecompressed --- Libraries/Core/Servers/Http/SptHttpListener.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Core/Servers/Http/SptHttpListener.cs b/Libraries/Core/Servers/Http/SptHttpListener.cs index 7d0237e6..9d41fba5 100644 --- a/Libraries/Core/Servers/Http/SptHttpListener.cs +++ b/Libraries/Core/Servers/Http/SptHttpListener.cs @@ -185,11 +185,11 @@ public class SptHttpListener : IHttpListener public void SendJson(HttpResponse resp, string? output, string sessionID) { - if (!string.IsNullOrEmpty(output)) - resp.Body = new MemoryStream(Encoding.UTF8.GetBytes(output)); resp.StatusCode = 200; resp.ContentType = "application/json"; resp.Headers.Append("Set-Cookie", $"PHPSESSID={sessionID}"); + if (!string.IsNullOrEmpty(output)) + resp.Body.WriteAsync(Encoding.UTF8.GetBytes(output)).AsTask().Wait(); resp.StartAsync().Wait(); resp.CompleteAsync().Wait(); }