-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[blazor] Set Cross-Origin-Policy headers for multi-threaded runtime #47855
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 |
@@ -29,6 +29,21 @@ public static void Configure(IApplicationBuilder app, IConfiguration configurati | |||
|
|||
app.UseWebAssemblyDebugging(); | |||
|
|||
app.Use(async (ctx, next) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
SharedArrayBuffer
in 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