mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Support passing relative URLs CSP builder (#19176)
Raw paths like `/test/path` are not supported natively in the CSP. This commit prepends the site's base URL to these paths. This allows plugins to add 'local' assets to the CSP without needing to hardcode the site's hostname.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
# authors: xrav3nz
|
||||
|
||||
extend_content_security_policy(
|
||||
script_src: ['https://from-plugin.com'],
|
||||
script_src: ['https://from-plugin.com', '/local/path'],
|
||||
object_src: ['https://test-stripping.com'],
|
||||
frame_ancestors: ['https://frame-ancestors-plugin.ext'],
|
||||
manifest_src: ['https://manifest-src.com']
|
||||
|
||||
Reference in New Issue
Block a user