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:
David Taylor
2022-11-24 11:27:47 +00:00
committed by GitHub
parent a34838d671
commit 174a8b431b
3 changed files with 17 additions and 8 deletions

View File

@@ -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']