about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorJeong Arm <kjwonmail@gmail.com>2022-06-24 06:09:32 +0900
committerGitHub <noreply@github.com>2022-06-23 23:09:32 +0200
commit6c2d3038f421a94171594c70d490daeec1e1a2d7 (patch)
tree8690d81c99c3b92127fd80aae0d4685ef26af304 /app
parent65ad58984808c482de60894f4210a5595bd96eb2 (diff)
Fix CDN_HOST not affected on full_asset_url (#18662)
* Fix CDN_HOST not affected to assets url

* Fix typo
Diffstat (limited to 'app')
-rw-r--r--app/helpers/routing_helper.rb6
1 files changed, 5 insertions, 1 deletions
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)