-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[Blazor] Fix multiple CSP policies #55200
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
Conversation
src/Components/Server/src/Builder/ServerRazorComponentsEndpointConventionBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
} | ||
else | ||
{ | ||
Assert.DoesNotContain("Content-Security-Policy", response.Headers.Select(h => h.Key)); |
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.
Is this assertion really correct? If you're requesting the ?add-csp
response, that should add at least one CSP in all cases, wouldn't it?
Or is it possible this test code never actually runs? It's hard to reason about with the subclasses and ExpectedPolicy
etc.
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.
Yeah, it's hard to write these tests. I copy pasted it from another test but validated that it works (that section doesn't run).
I'll clean that up.
src/Components/test/E2ETest/ServerExecutionTests/WebSocketCompressionTests.cs
Show resolved
Hide resolved
…tConventionBuilderExtensions.cs Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
src/Components/test/E2ETest/ServerExecutionTests/WebSocketCompressionTests.cs
Outdated
Show resolved
Hide resolved
src/Components/test/E2ETest/ServerExecutionTests/WebSocketCompressionTests.cs
Outdated
Show resolved
Hide resolved
src/Components/test/E2ETest/ServerExecutionTests/WebSocketCompressionTests.cs
Show resolved
Hide resolved
…ressionTests.cs Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
Updates the CSP policy handling by Blazor to append to an existing policy if present.