Skip to content

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

Open
flyth wants to merge 1 commit into
mainfrom
michael/search
Open

staticwebapp config: allow unsafe-eval and unsafe-inline in CSP#94
flyth wants to merge 1 commit into
mainfrom
michael/search

Conversation

@flyth

@flyth flyth commented Sep 11, 2024

Copy link
Copy Markdown
Member

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

@github-actions

Copy link
Copy Markdown

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

@flyth

flyth commented Sep 11, 2024

Copy link
Copy Markdown
Member Author

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

@mauriciovasquezbernal

Copy link
Copy Markdown
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

flyth commented Sep 12, 2024

Copy link
Copy Markdown
Member Author

@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

sniok commented Sep 13, 2024

Copy link
Copy Markdown
Collaborator

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
@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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