From c7dfb1c549c29e560ea24558bc1a32d8991625c2 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 28 Jul 2022 20:38:22 +0100 Subject: [PATCH] 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. --- app/models/javascript_cache.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/javascript_cache.rb b/app/models/javascript_cache.rb index b92509bb892..b5dca967ea2 100644 --- a/app/models/javascript_cache.rb +++ b/app/models/javascript_cache.rb @@ -12,7 +12,7 @@ class JavascriptCache < ActiveRecord::Base end def local_url - "#{Discourse.base_url}#{path}" + "#{Discourse.base_path}/#{path}" end private