DEV: Use relative URLs for theme_uploads_local (#17715)

Relative URLs will work just fine for Web Workers, which were the original reason for introducing the `theme_uploads_local` feature

Making them relative will mean that `loadScript()` automatically uses the CDN (when enabled), which is doubly important because our CSP doesn't allow loading theme-javascripts from the host domain when the CDN is enabled.
This commit is contained in:
David Taylor 2022-07-28 20:38:22 +01:00 committed by GitHub
parent a737195687
commit c7dfb1c549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ class JavascriptCache < ActiveRecord::Base
end
def local_url
"#{Discourse.base_url}#{path}"
"#{Discourse.base_path}/#{path}"
end
private