From 1000465d859c7790b0ef802b803c6267a5571c55 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sat, 6 Nov 2021 03:27:18 +0100 Subject: [PATCH] Simplify allow_other_host extraction so it's easier to read --- actionpack/lib/action_controller/metal/redirecting.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/lib/action_controller/metal/redirecting.rb b/actionpack/lib/action_controller/metal/redirecting.rb index 322c1d8a8b6f6..e602d56f6a11a 100644 --- a/actionpack/lib/action_controller/metal/redirecting.rb +++ b/actionpack/lib/action_controller/metal/redirecting.rb @@ -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)