mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Do not include URL query in auto-generated CSP header (#11673)
This commit is contained in:
@@ -70,6 +70,8 @@ class ContentSecurityPolicy
|
||||
next if uri.host.nil? # Ignore same-domain scripts (theme-javascripts)
|
||||
next if uri.path.nil? # Ignore raw hosts
|
||||
|
||||
uri.query = nil # CSP should not include query part of url
|
||||
|
||||
uri_string = uri.to_s.sub(/^\/\//, '') # Protocol-less CSP should not have // at beginning of URL
|
||||
|
||||
auto_script_src_extension[:script_src] << uri_string
|
||||
|
||||
Reference in New Issue
Block a user