File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,10 @@ def content_security_policy(self):
62
62
63
63
Can be overridden by defining Content-Security-Policy in settings['headers']
64
64
"""
65
+ if 'Content-Security-Policy' in self .settings .get ('headers' , {}):
66
+ # user-specified, don't override
67
+ return self .settings ['headers' ]['Content-Security-Policy' ]
68
+
65
69
return '; ' .join ([
66
70
"frame-ancestors 'self'" ,
67
71
# Make sure the report-uri is relative to the base_url
@@ -72,9 +76,8 @@ def set_default_headers(self):
72
76
headers = {}
73
77
headers .update (self .settings .get ('headers' , {}))
74
78
75
- if "Content-Security-Policy" not in headers :
76
- headers ["Content-Security-Policy" ] = self .content_security_policy
77
-
79
+ headers ["Content-Security-Policy" ] = self .content_security_policy
80
+
78
81
# Allow for overriding headers
79
82
for header_name , value in headers .items ():
80
83
try :
You can’t perform that action at this time.
0 commit comments