-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Content Security Policy blocks script execution in default template. #37992
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
Comments
Hello @wbalzer, thanks for contacting us. The initial error is discussed as a part of #33068.
Can you please try:
The CSP guidance is to be updated along with the release of 6.0: https://github.com/dotnet/AspNetCore.Docs/pull/23365/files
Could you please try another browser to see if the issue is resolved. Are you able to disable the CSP in the development environment so it doesn't conflict with |
Hi @wbalzer. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
After placing the CSP meta tag below the viewport meta tag, I am receiving these errors (Both Chrome and Edge) ...
I also received the Type error as before. |
Thanks @wbalzer, are you able to disable the CSP in the development environment so it doesn't cause these issues? You'd mentioned previously:
Note, to disable the CSP you'll also have the remove the |
Thanks for contacting us. This seems to be a dupe of #33068 |
@TanayParikh I'm using Visual Studio Preview 2022. I don't know if there is a clear way to disable CSP in development. |
After creating a new WASM Core Hosted PWA with Individual Accounts, I noticed that after applying Migrations and logging in, I am getting an error…
I am also getting...
I don’t have any visible errors on the page, but I noticed that JavaScript inside a SCRIPT tag on a page, is also refusing to run because of a Content Security Policy. I’m not sure if this policy is new to the browser, or if the policy is new because of our Corporate Group Policies. I have tried to follow the instructions on:
https://docs.microsoft.com/en-us/aspnet/core/blazor/security/content-security-policy?view=aspnetcore-6.0
I wasn’t able to figure out how to set the meta tag to prevent the error and allow JS constants to be written inside a SCRIPT tag that may change from a configuration in the launch settings. Any ideas?
The text was updated successfully, but these errors were encountered: