From 955e75e82076bd5f5e7aaf165bc7b30a0afa48e4 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 26 May 2025 15:19:19 +0200 Subject: [PATCH] Fix premailer strategy when using CDN_HOST (#34813) --- lib/premailer_bundled_asset_strategy.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/premailer_bundled_asset_strategy.rb b/lib/premailer_bundled_asset_strategy.rb index 3065777d29..f02f49e6f9 100644 --- a/lib/premailer_bundled_asset_strategy.rb +++ b/lib/premailer_bundled_asset_strategy.rb @@ -15,7 +15,9 @@ module PremailerBundledAssetStrategy headers ).presence else - path = Rails.public_path.join(url.delete_prefix('/')) + url = url.delete_prefix(Rails.configuration.action_controller.asset_host) if Rails.configuration.action_controller.asset_host.present? + url = url.delete_prefix('/') + path = Rails.public_path.join(url) return unless path.exist? path.read