Fix premailer strategy when using CDN_HOST (#34813)

This commit is contained in:
Claire 2025-05-26 15:19:19 +02:00 committed by GitHub
parent b7e967817b
commit 955e75e820
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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