[blazor] Set Cross-Origin-Policy headers for multi-threaded runtime#47855
[blazor] Set Cross-Origin-Policy headers for multi-threaded runtime#47855maraf merged 5 commits intodotnet:mainfrom
Conversation
|
@javiercn I'm not sure if this is enough for hosted mode |
|
@maraf unfortunately no. We'll have to find a solution for it. The best way to do it so far is to apply the changes in the app code directly, on the call to |
|
@javiercn Do we want this change set for standalone mode? |
|
@maraf I think so, but we need to understand what consequences (if any) to the dev/deployment experience this has. /cc: @SteveSandersonMS has thoughts in this space. |
|
Longer term I am hoping we can turn these headers dynamically based on configuration or a build time switch. |
|
I can move the changes around so they are valid only for devserver |
|
|
||
| app.UseWebAssemblyDebugging(); | ||
|
|
||
| app.Use(async (ctx, next) => |
There was a problem hiding this comment.
Can the DevServer find out about the project build properties somehow? I don't think we want COP for arbitrary blazor projects. it could break someone's existing single threaded project, I think?
There was a problem hiding this comment.
The last change works when the property is put in a csproj. It doesn't accept is passed as commnad-line argument
There was a problem hiding this comment.
@radical Do you know if there is a way to "evaluate" properties passed as command-line arguments during dotnet run? The passed property has correct value during build, but when RunArguments evaluate, it ignores value from command-line
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
|
Could we detect that the application has Should that parameter also do something to the published app's server ? |
|
Detecting |
|
I mean in the project file. |
|
@javiercn @pavelsavara Do we want to take this approach? There is a bug in MSBuild property evaluation dotnet/sdk#32551 which breaks it when the property is passed as command-like argument. The issue is assigned and should get fixed. Anyway, I believe that the multi-threading will be almost always set in csproj. |
|
I prefer to make it work with |
The multi-threaded runtime requires COP headers to enable
SharedArrayBufferin the browser.In this PR we set them for
It changes only DevServer.
The runtime changes to enable threads in blazor are in the dotnet/runtime#85109