-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Closed
Copy link
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-VM-meta-monoos-browserBrowser variant of arch-wasmBrowser variant of arch-wasm
Milestone
Description
Description
When running an app using the WasmAppHost, the server forces COOP/COEP:
runtime/src/mono/wasm/host/WebServerStartup.cs
Lines 91 to 99 in f87428b
| if (options.WebServerUseCrossOriginPolicy) | |
| { | |
| app.Use((context, next) => | |
| { | |
| context.Response.Headers.Append("Cross-Origin-Embedder-Policy", "require-corp"); | |
| context.Response.Headers.Append("Cross-Origin-Opener-Policy", "same-origin"); | |
| return next(); | |
| }); | |
| } |
This causes issues for apps that don't need this particular feature.
Reproduction Steps
Create an browser wasm app, then add a img that references a non-compatible image.
Expected behavior
The image displays when starting the app from VS.
Actual behavior
net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 200 (OK)
Regression?
Not sure.
Known Workarounds
None, since the headers are set unconditionally:
runtime/src/mono/wasm/host/BrowserHost.cs
Lines 124 to 131 in f87428b
| private static WebServerOptions CreateWebServerOptions(string[] urls, string appPath, Func<WebSocket, Task>? onConsoleConnected) => new | |
| ( | |
| OnConsoleConnected: onConsoleConnected, | |
| ContentRootPath: Path.GetFullPath(appPath), | |
| WebServerUseCors: true, | |
| WebServerUseCrossOriginPolicy: true, | |
| Urls: urls | |
| ); |
Configuration
9.0.100
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-VM-meta-monoos-browserBrowser variant of arch-wasmBrowser variant of arch-wasm