Skip to content

Apply default headers to FailureApp responses - #5879

Open
ozamasa wants to merge 1 commit into
heartcombo:mainfrom
ozamasa:fix/failure-app-default-headers
Open

ozamasa wants to merge 1 commit into
heartcombo:mainfrom
ozamasa:fix/failure-app-default-headers

Conversation

@ozamasa

@ozamasa ozamasa commented Nov 5, 2026

Copy link
Copy Markdown

Summary

  • include ActionController::DefaultHeaders in Devise::FailureApp
  • apply config.action_dispatch.default_headers to failure responses
  • verify that headers set explicitly by FailureApp still override defaults

FailureApp inherits directly from ActionController::Metal, so it does not receive the default-header behavior included by ActionController::Base and ActionController::API. Using Rails' ActionController::DefaultHeaders module keeps the response construction and header precedence consistent with Rails controllers.

Fixes #5201.

Testing

  • Rails 8.1.3 / Ruby 3.4.1: test/failure_app_test.rb (46 runs, 92 assertions)
  • Rails 8.1.3 / Ruby 3.4.1: full Active Record suite (880 runs, 2472 assertions)
  • Rails 7.0.10 / Ruby 3.4.1: test/failure_app_test.rb (46 runs, 96 assertions)
  • Rails 7.0.10 / Ruby 3.4.1: full Active Record suite (879 runs, 2412 assertions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

config.action_dispatch.default_headers are ignored in FailureApp

1 participant