Permalink
Browse files

pull the port out of the options hash once

  • Loading branch information...
1 parent ed37698 commit a64914de4c41473c4bfecec1c69cfc931ccb6281 @tenderlove tenderlove committed Jun 11, 2014
Showing with 3 additions and 2 deletions.
  1. +3 −2 actionpack/lib/action_dispatch/http/url.rb
@@ -75,10 +75,11 @@ def add_trailing_slash(path)
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 @@ def build_host_url(options)
end
result << host
- normalize_port(options[:port], protocol) { |port|
+ normalize_port(port, protocol) { |port|
result << ":#{port}"
}

0 comments on commit a64914d

Please sign in to comment.