diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f27627150..ea52609a7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base include CurrentRequest, CurrentTimezone, SetPlatform include TurboFlash, ViewTransitions include Saas - include WriterAffinity + include RoutingHeaders, WriterAffinity stale_when_importmap_changes allow_browser versions: :modern diff --git a/app/controllers/concerns/routing_headers.rb b/app/controllers/concerns/routing_headers.rb new file mode 100644 index 000000000..195f9bdc7 --- /dev/null +++ b/app/controllers/concerns/routing_headers.rb @@ -0,0 +1,12 @@ +module RoutingHeaders + extend ActiveSupport::Concern + + included do + before_action :set_target_header + end + + private + def set_target_header + response.headers["X-Kamal-Target"] = request.headers["X-Kamal-Target"] + end +end