-
Notifications
You must be signed in to change notification settings - Fork 4
fix(security): CSP report-only and security headers #424
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
base: fix/seo
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,27 @@ | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "headers": [ | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "source": "/(.*)", | ||||||||||||||||||||||
| "headers": [ | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "key": "Content-Security-Policy-Report-Only", | ||||||||||||||||||||||
| "value": "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://va.vercel-scripts.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https: blob:; connect-src 'self' https: wss:; frame-ancestors 'none'; report-uri /csp-report" | ||||||||||||||||||||||
|
||||||||||||||||||||||
| "value": "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://va.vercel-scripts.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https: blob:; connect-src 'self' https: wss:; frame-ancestors 'none'; report-uri /csp-report" | |
| "value": "default-src 'self'; script-src 'self' https://va.vercel-scripts.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https: blob:; connect-src 'self' https://va.vercel-scripts.com; frame-ancestors 'none'; report-uri /csp-report" |
Copilot
AI
Mar 23, 2026
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.
report-uri is deprecated in favor of report-to / Reporting-Endpoints. If you’re adding CSP reporting infrastructure now, consider switching to the newer reporting directives (and adding the corresponding Report-To/Reporting-Endpoints header) to avoid having to migrate later.
| "value": "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://va.vercel-scripts.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https: blob:; connect-src 'self' https: wss:; frame-ancestors 'none'; report-uri /csp-report" | |
| }, | |
| { | |
| "value": "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://va.vercel-scripts.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https: blob:; connect-src 'self' https: wss:; frame-ancestors 'none'; report-to csp-endpoint" | |
| }, | |
| { | |
| "key": "Report-To", | |
| "value": "{\"group\":\"csp-endpoint\",\"max_age\":10886400,\"endpoints\":[{\"url\":\"/csp-report\"}]}" | |
| }, | |
| { |
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.
report-uri /csp-reportpoints to an endpoint that doesn’t appear to exist in the repo, and the current catch-all SPA rewrite (/(.*)->/) will also rewrite/csp-reportto/. As a result, CSP violation reports won’t be received/processed, which defeats the stated purpose of this PR. Consider either (a) implementing a real report ingestion endpoint (e.g., a Vercel Function) and exempting it from the rewrite, or (b) sending reports to an external HTTPS endpoint instead of a rewritten path.