Skip to content

Commit

Permalink
Add commit from QEDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonakemon committed Jun 8, 2021
1 parent 278b0e9 commit cd96f6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions flask_talisman/talisman.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

DEFAULT_CSP_POLICY = {
'default-src': '\'self\'',
'object-src': '\'none\'',
}

GOOGLE_CSP_POLICY = {
Expand All @@ -39,6 +40,7 @@
# Used by generated code from http://www.google.com/fonts
'style-src': '\'self\' ajax.googleapis.com fonts.googleapis.com '
'*.gstatic.com',
'object-src': '\'none\'',
'default-src': '\'self\' *.gstatic.com',
}

Expand Down
4 changes: 2 additions & 2 deletions flask_talisman/talisman_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def testDefaults(self):
'max-age=31556926; includeSubDomains',
'X-XSS-Protection': '1; mode=block',
'X-Content-Type-Options': 'nosniff',
'Content-Security-Policy': 'default-src \'self\'',
'Content-Security-Policy': 'default-src \'self\'; object-src \'none\'',
'Referrer-Policy': 'strict-origin-when-cross-origin'
}

Expand Down Expand Up @@ -134,7 +134,7 @@ def testContentSecurityPolicyOptions(self):
self.talisman.content_security_policy['image-src'] = '*'
response = self.client.get('/', environ_overrides=HTTPS_ENVIRON)
csp = response.headers['Content-Security-Policy']
self.assertEqual(csp, "default-src 'self'; image-src *")
self.assertEqual(csp, "default-src 'self'; object-src \'none\'; image-src *")

self.talisman.content_security_policy['image-src'] = [
'\'self\'',
Expand Down

0 comments on commit cd96f6e

Please sign in to comment.