Skip to content

Conversation

y-yagi
Copy link
Member

@y-yagi y-yagi commented Sep 28, 2025

Motivation / Background

This Pull Request has been created because since #55496, the depreciation message about raise_on_open _redirects is shown in newly generated applications.

This is because the deprecations is shown when raise_on_open_redirects is not null, but the default value of it is false.

if app.config.action_controller.raise_on_open_redirects != nil
config.action_controller.raise_on_open_redirects = false

In addition that, we set the value in load_defaults.

action_controller.raise_on_open_redirects = true

Detail

This Pull Request removed config key and checked the key existence for the condition of deprecation message to avoid the deprecation message in newly generated applications.

Fixes #55772.

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Since rails#55496, the depreciation message about `raise_on_open _redirects`
is shown in newly generated applications.

This is because the deprecations is shown when `raise_on_open_redirects`
is not null, but the default value of it is `false`.
https://github.com/rails/rails/blob/ec4337aae7d358e9d8ae3fc539347a2618b8fbe0/actionpack/lib/action_controller/railtie.rb#L110
https://github.com/rails/rails/blob/ec4337aae7d358e9d8ae3fc539347a2618b8fbe0/actionpack/lib/action_controller/railtie.rb#L15

In addition that, we set the value in `load_defaults`.
https://github.com/rails/rails/blob/ec4337aae7d358e9d8ae3fc539347a2618b8fbe0/railties/lib/rails/application/configuration.rb#L270

This PR removed config key and checked the key existence for the
condition of deprecation message.

Fixes rails#55772.
@y-yagi y-yagi marked this pull request as ready for review September 28, 2025 07:29
@byroot byroot merged commit 71bfd59 into rails:main Sep 28, 2025
3 checks passed
@y-yagi y-yagi deleted the fixes_55772 branch September 28, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ApplicationTests::RackTests::LoggerTest raises DEPRECATION WARNING: raise_on_open_redirects is deprecated

2 participants