aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-06-11 15:01:30 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-06-11 15:01:30 -0700
commita64914de4c41473c4bfecec1c69cfc931ccb6281 (patch)
treeb6fd4c9a40c68331f666cb07c002db4cd222fd0e /actionpack
parented376985967e3c1391b57cf1f715b6a982e8c039 (diff)
downloadrails-a64914de4c41473c4bfecec1c69cfc931ccb6281.tar.gz
rails-a64914de4c41473c4bfecec1c69cfc931ccb6281.tar.bz2
rails-a64914de4c41473c4bfecec1c69cfc931ccb6281.zip
pull the port out of the options hash once
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/http/url.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb
index e970d20c39..9b5257ef96 100644
--- a/actionpack/lib/action_dispatch/http/url.rb
+++ b/actionpack/lib/action_dispatch/http/url.rb
@@ -75,10 +75,11 @@ module ActionDispatch
def build_host_url(options)
protocol = options[:protocol]
host = options[:host]
+ port = options[:port]
if match = host.match(HOST_REGEXP)
protocol ||= match[1] unless protocol == false
host = match[2]
- options[:port] = match[3] unless options.key?(:port)
+ port = match[3] unless options.key? :port
end
protocol = normalize_protocol protocol
@@ -91,7 +92,7 @@ module ActionDispatch
end
result << host
- normalize_port(options[:port], protocol) { |port|
+ normalize_port(port, protocol) { |port|
result << ":#{port}"
}