From: Jeong Arm Date: Thu, 23 Jun 2022 21:09:32 +0000 (+0900) Subject: Fix CDN_HOST not affected on full_asset_url (#18662) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=c850a43cd70f6fcc90b882a54fb69bf084db8afe;p=mastodon.git Fix CDN_HOST not affected on full_asset_url (#18662) * Fix CDN_HOST not affected to assets url * Fix typo --- diff --git a/app/helpers/routing_helper.rb b/app/helpers/routing_helper.rb index f95f46a56..0d5a8505a 100644 --- a/app/helpers/routing_helper.rb +++ b/app/helpers/routing_helper.rb @@ -16,7 +16,11 @@ module RoutingHelper def full_asset_url(source, **options) source = ActionController::Base.helpers.asset_url(source, **options) unless use_storage? - URI.join(root_url, source).to_s + URI.join(asset_host, source).to_s + end + + def asset_host + Rails.configuration.action_controller.asset_host || root_url end def full_pack_url(source, **options)