-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
refactor: ♻️ ContentSecurityPolicy as an object #1312
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Risk Level 2 - /home/runner/work/quivr/quivr/frontend/next.config.js The code changes seem to be mostly about adding a Content Security Policy (CSP) and updating the security headers. This is generally a good practice for improving the security of the application. However, there are a few points to consider:
Here's an example of how you could refactor the CSP: const CSP_URLS = process.env.CSP_URLS ? process.env.CSP_URLS.split(',') : [];
const ContentSecurityPolicy = {
\"default-src\": [
\"'self'\",
...CSP_URLS,
],
// rest of the CSP...
}; This way, you can manage the URLs from the environment variables. 🔒🚫🔧 Powered by Code Review GPT |
* ♻️ ContentSecurityPolicy as an object * CSP: Remove redundant operation
Description
Improve developper experience with CSP by turning the csp into object instead of a large string.
Developped in TDD with the following test
External checks
Syntax validity checked with : https://csp-evaluator.withgoogle.com/