about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-06-28 11:11:18 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-06-28 11:11:18 +0200
commitfe5f6bc7edf42e8c87dbdfa98f5707020e42d400 (patch)
tree2e632dfa964aad5cf118930389cf95904f3bd82a /app/helpers
parent63f79874b59b3ba28c0f940b9d36ea7aacb44c93 (diff)
parent02851848e964675bb59919fa5fd1bdee2c1c29db (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `.github/workflows/build-image.yml`:
  Fix erroneous deletion in a previous merge.
- `Gemfile`:
  Conflict caused by glitch-soc-only hCaptcha dependency
- `app/controllers/auth/sessions_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
- `app/controllers/filters_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
- `app/serializers/rest/status_serializer.rb`:
  Minor conflict due to glitch-soc having an extra `local_only` property
Diffstat (limited to 'app/helpers')
-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)