about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mastodon/premailer_webpack_strategy.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/mastodon/premailer_webpack_strategy.rb b/lib/mastodon/premailer_webpack_strategy.rb
index 4ea3ce80c..84d83cc66 100644
--- a/lib/mastodon/premailer_webpack_strategy.rb
+++ b/lib/mastodon/premailer_webpack_strategy.rb
@@ -2,6 +2,9 @@
 
 module PremailerWebpackStrategy
   def load(url)
+    public_path_host = ENV['ASSET_HOST'] || ENV['LOCAL_DOMAIN']
+    url = url.gsub(/\A\/\/#{public_path_host}/, '')
+
     if Webpacker.dev_server.running?
       url = File.join("#{Webpacker.dev_server.protocol}://#{Webpacker.dev_server.host_with_port}", url)
       HTTP.get(url).to_s