Skip to content

Commit

Permalink
Only load over https, simplify check for local env
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeaufort committed Aug 28, 2019
1 parent 1faeb80 commit 6018542
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fec/fec/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ def process_response(self, request, response):
content_security_policy = {
"default-src": "'self' *.fec.gov *.app.cloud.gov https://www.google-analytics.com",
"frame-src": "'self' https://www.google.com/recaptcha/",
"img-src": "'self' data: http://*.fastly.net https://www.google-analytics.com",
"img-src": "'self' data: https://*.ssl.fastly.net https://www.google-analytics.com",
"script-src": "'self' 'unsafe-inline' 'unsafe-eval' https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/ https://www.google-analytics.com https://polyfill.io https://dap.digitalgov.gov",
"style-src": "'self' data: 'unsafe-inline'",
"object-src": "'none'",
"report-uri": REPORT_URI,
}
if settings.FEC_CMS_ENVIRONMENT == settings.ENVIRONMENTS.get('local'):
if settings.FEC_CMS_ENVIRONMENT == 'LOCAL':
content_security_policy["default-src"] += " localhost:* http://127.0.0.1:*"

response["Content-Security-Policy"] = "".join(
Expand Down

0 comments on commit 6018542

Please sign in to comment.