mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 11:11:13 +08:00
FEATURE: Optionally allow a separate s3_asset_cdn_url
to be specified (#19284)
If configured, this will be used for static JS assets which are stored on S3. This can be useful if you want to use different CDN providers/configuration for Uploads and JS
This commit is contained in:
@ -133,6 +133,19 @@ RSpec.describe ContentSecurityPolicy do
|
||||
https://cdn.com/theme-javascripts/
|
||||
http://test.localhost/extra-locales/
|
||||
])
|
||||
|
||||
global_setting(:s3_asset_cdn_url, 'https://s3-asset-cdn.com')
|
||||
|
||||
script_srcs = parse(policy)['script-src']
|
||||
expect(script_srcs).to include(*%w[
|
||||
https://s3-asset-cdn.com/assets/
|
||||
https://s3-asset-cdn.com/brotli_asset/
|
||||
https://cdn.com/highlight-js/
|
||||
https://cdn.com/javascripts/
|
||||
https://cdn.com/plugins/
|
||||
https://cdn.com/theme-javascripts/
|
||||
http://test.localhost/extra-locales/
|
||||
])
|
||||
end
|
||||
|
||||
it 'adds subfolder to CDN assets' do
|
||||
|
Reference in New Issue
Block a user