Skip to content

Commit

Permalink
staticwebapp config: allow unsafe-eval and unsafe-inline in CSP
Browse files Browse the repository at this point in the history
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
  • Loading branch information
flyth committed Sep 11, 2024
1 parent a4ed0bb commit 2a3bd0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions static/staticwebapp.config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"globalHeaders": {
"Content-Type": "text/html; charset=UTF-8",
"Content-Security-Policy": "script-src 'self'",
"Content-Security-Policy": "script-src 'self' 'unsafe-eval' 'unsafe-inline'",
"Permissions-Policy": "geolocation=(), microphone=(), camera=()",
"X-Frame-Options": "SAMEORIGIN",
"X-Permitted-Cross-Domain-Policies": "none"
}
}
}

0 comments on commit 2a3bd0b

Please sign in to comment.