Skip to content

Commit 1000465

Browse files
committed
Simplify allow_other_host extraction so it's easier to read
1 parent b0d1493 commit 1000465

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

actionpack/lib/action_controller/metal/redirecting.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def redirect_to(options = {}, response_options = {})
8383
raise ActionControllerError.new("Cannot redirect to nil!") unless options
8484
raise AbstractController::DoubleRenderError if response_body
8585

86-
allow_other_host = response_options.key?(:allow_other_host) ? response_options.delete(:allow_other_host) : _allow_other_host
86+
allow_other_host = response_options.delete(:allow_other_host) { _allow_other_host }
8787

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

0 commit comments

Comments
 (0)