Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/mono
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2022-03-08 23:55:35 +0300
committerGitHub <noreply@github.com>2022-03-08 23:55:35 +0300
commit51ecbf333d20e1ed5c5ead3c85c1f5c958d8840a (patch)
tree7c0a122ef4abad3974811a22190e3e2ddba3d0a0 /src/mono
parent3044c3bdc5de1f877501f21bf928bcb4abef28dd (diff)
[release/6.0] [wasm][debugger] Fix (chrome|edge)://inspect for the debug proxy (#65219)
* Inspector wants the content-length set * Use utf8 length Co-authored-by: Larry Ewing <lewing@microsoft.com>
Diffstat (limited to 'src/mono')
-rw-r--r--src/mono/wasm/debugger/BrowserDebugHost/Startup.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs b/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs
index c4de27f4ee9..8583186ad64 100644
--- a/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs
+++ b/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs
@@ -7,6 +7,7 @@ using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Text.Json;
+using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@@ -139,7 +140,9 @@ namespace Microsoft.WebAssembly.Diagnostics
Dictionary<string, string>[] tabs = await ProxyGetJsonAsync<Dictionary<string, string>[]>(GetEndpoint(context));
Dictionary<string, string>[] alteredTabs = tabs.Select(t => mapFunc(t, context, devToolsHost)).ToArray();
context.Response.ContentType = "application/json";
- await context.Response.WriteAsync(JsonSerializer.Serialize(alteredTabs));
+ byte[] bytes = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(alteredTabs));
+ context.Response.ContentLength = bytes.Length;
+ await context.Response.Body.WriteAsync(bytes);
}
async Task ConnectProxy(HttpContext context)