mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove deprecated Rails.config.action_dispatch.hosts_response_app
This commit is contained in:
parent
073baba024
commit
4f5989bf91
5 changed files with 8 additions and 17 deletions
|
@ -1,3 +1,7 @@
|
|||
* Remove deprecated `Rails.config.action_dispatch.hosts_response_app`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove deprecated `ActionDispatch::Response.return_only_media_type_on_content_type`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
|
|
@ -98,20 +98,11 @@ module ActionDispatch
|
|||
end
|
||||
end
|
||||
|
||||
def initialize(app, hosts, deprecated_response_app = nil, exclude: nil, response_app: nil)
|
||||
def initialize(app, hosts, exclude: nil, response_app: nil)
|
||||
@app = app
|
||||
@permissions = Permissions.new(hosts)
|
||||
@exclude = exclude
|
||||
|
||||
unless deprecated_response_app.nil?
|
||||
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
||||
`action_dispatch.hosts_response_app` is deprecated and will be ignored in Rails 7.0.
|
||||
Use the Host Authorization `response_app` setting instead.
|
||||
MSG
|
||||
|
||||
response_app ||= deprecated_response_app
|
||||
end
|
||||
|
||||
@response_app = response_app || DefaultResponseApp.new
|
||||
end
|
||||
|
||||
|
|
|
@ -259,12 +259,6 @@ class HostAuthorizationTest < ActionDispatch::IntegrationTest
|
|||
assert_match "Blocked host: sub-example.com", response.body
|
||||
end
|
||||
|
||||
test "config setting action_dispatch.hosts_response_app is deprecated" do
|
||||
assert_deprecated do
|
||||
ActionDispatch::HostAuthorization.new(App, "example.com", ->(env) { true })
|
||||
end
|
||||
end
|
||||
|
||||
test "uses logger from the env" do
|
||||
@app = ActionDispatch::HostAuthorization.new(App, %w(only.com))
|
||||
output = StringIO.new
|
||||
|
|
|
@ -54,6 +54,8 @@ Please refer to the [Changelog][action-pack] for detailed changes.
|
|||
|
||||
* Remove deprecated `ActionDispatch::Response.return_only_media_type_on_content_type`.
|
||||
|
||||
* Remove deprecated `Rails.config.action_dispatch.hosts_response_app`.
|
||||
|
||||
### Deprecations
|
||||
|
||||
### Notable changes
|
||||
|
|
|
@ -13,7 +13,7 @@ module Rails
|
|||
|
||||
def build_stack
|
||||
ActionDispatch::MiddlewareStack.new do |middleware|
|
||||
middleware.use ::ActionDispatch::HostAuthorization, config.hosts, config.action_dispatch.hosts_response_app, **config.host_authorization
|
||||
middleware.use ::ActionDispatch::HostAuthorization, config.hosts, **config.host_authorization
|
||||
|
||||
if config.force_ssl
|
||||
middleware.use ::ActionDispatch::SSL, **config.ssl_options,
|
||||
|
|
Loading…
Reference in a new issue