Skip to content
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

staticwebapp config: allow unsafe-eval and unsafe-inline in CSP #94

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

flyth
Copy link
Member

@flyth flyth commented Sep 11, 2024

Currently the website complains that both unsafe-eval and unsafe-inline are not allowed by the Content Security Policy. However, it seems that the former is required for the search feature and the latter to be able to store the theme selection. The theme selection could be imported differently to prevent the need for unsafe-inline, but for the time being this should solve both issues.

Fixes #61

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-mushroom-00d947803-94.westeurope.1.azurestaticapps.net

@flyth
Copy link
Member Author

flyth commented Sep 11, 2024

Ah, there was already #74 with a similar solution, sorry.

@mauriciovasquezbernal
Copy link
Member

@flyth I merged the other one following your comments. Do you think we can close this or is there anything we need to do?

@flyth
Copy link
Member Author

flyth commented Sep 12, 2024

@flyth I merged the other one following your comments. Do you think we can close this or is there anything we need to do?

I think this would have given a slightly better rating because it still keeps the CSP for third party websites, but I don't think there's a big difference with the content we serve.

/cc @sniok WDYT?

@sniok
Copy link
Collaborator

sniok commented Sep 13, 2024

Yeah having some CSP is better than nothing

…line

This adds the CSP back and also adds unsafe-eval and unsafe-inline which are
needed for the search functionality and theme settings.

Fixes #61
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-mushroom-00d947803-94.westeurope.1.azurestaticapps.net

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://polite-mushroom-00d947803-94.westeurope.1.azurestaticapps.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Searching is not working
3 participants