From ec1caddb7f93a4277a6ab0727b2c41b34cafbfa5 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 11 Jun 2014 11:42:49 -0700 Subject: only pull :protocol from the options hash once --- actionpack/lib/action_dispatch/http/url.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_dispatch/http') diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index 6444fa6f78..86915cfc27 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -73,13 +73,14 @@ module ActionDispatch end def build_host_url(options) + protocol = options[:protocol] if match = options[:host].match(HOST_REGEXP) - options[:protocol] ||= match[1] unless options[:protocol] == false + protocol ||= match[1] unless protocol == false options[:host] = match[2] options[:port] = match[3] unless options.key?(:port) end - protocol = normalize_protocol options[:protocol] + protocol = normalize_protocol protocol options[:host] = normalize_host(options) result = protocol.dup -- cgit v1.2.3