Skip to content

Commit

Permalink
[release/6.0] [wasm][debugger] Fix (chrome|edge)://inspect for the de…
Browse files Browse the repository at this point in the history
…bug proxy (#65219)

* Inspector wants the content-length set

* Use utf8 length

Co-authored-by: Larry Ewing <lewing@microsoft.com>
  • Loading branch information
github-actions[bot] and lewing authored Mar 8, 2022
1 parent 3044c3b commit 51ecbf3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mono/wasm/debugger/BrowserDebugHost/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
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;
Expand Down Expand Up @@ -139,7 +140,9 @@ async Task RewriteArray(HttpContext context)
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)
Expand Down

0 comments on commit 51ecbf3

Please sign in to comment.