Skip to content

remove unsafe-inline csp for veterans #6586

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

Merged
merged 8 commits into from
Jul 27, 2022
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ workflows:
context : org-global
filters:
branches:
only:
- tco23
only:
- free
# This is alternate dev env for parallel testing
- "build-qa":
context : org-global
Expand Down
3 changes: 2 additions & 1 deletion src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ async function onExpressJsSetup(server) {
res.header('Permissions-Policy', 'geolocation=(), microphone=(), camera=()');

if (req.url.startsWith('/__community__/veterans') || req.hostname === 'veterans.topcoder.com' || req.url.startsWith('/__community__/tco') || tcoPattern.test(req.hostname)) {
res.header('Cache-Control', 'no-cache');
res.header(
'Content-Security-Policy',
"default-src 'self';"
+ " script-src 'report-sample' 'self' 'unsafe-inline' 'unsafe-eval'"
+ " script-src 'report-sample' 'self'"
+ ` ${config.CDN.PUBLIC}`
+ ' http://www.google-analytics.com'
+ ' https://www.google-analytics.com'
Expand Down