Skip to content

Commit

Permalink
Simplify allow_other_host extraction so it's easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspth committed Nov 6, 2021
1 parent b0d1493 commit 1000465
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_controller/metal/redirecting.rb
Expand Up @@ -83,7 +83,7 @@ def redirect_to(options = {}, response_options = {})
raise ActionControllerError.new("Cannot redirect to nil!") unless options
raise AbstractController::DoubleRenderError if response_body

allow_other_host = response_options.key?(:allow_other_host) ? response_options.delete(:allow_other_host) : _allow_other_host
allow_other_host = response_options.delete(:allow_other_host) { _allow_other_host }

self.status = _extract_redirect_to_status(options, response_options)
self.location = _enforce_open_redirect_protection(_compute_redirect_to_location(request, options), allow_other_host: allow_other_host)
Expand Down

0 comments on commit 1000465

Please sign in to comment.