mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
pull the port out of the options hash once
This commit is contained in:
parent
ed37698596
commit
a64914de4c
1 changed files with 3 additions and 2 deletions
|
@ -75,10 +75,11 @@ module ActionDispatch
|
||||||
def build_host_url(options)
|
def build_host_url(options)
|
||||||
protocol = options[:protocol]
|
protocol = options[:protocol]
|
||||||
host = options[:host]
|
host = options[:host]
|
||||||
|
port = options[:port]
|
||||||
if match = host.match(HOST_REGEXP)
|
if match = host.match(HOST_REGEXP)
|
||||||
protocol ||= match[1] unless protocol == false
|
protocol ||= match[1] unless protocol == false
|
||||||
host = match[2]
|
host = match[2]
|
||||||
options[:port] = match[3] unless options.key?(:port)
|
port = match[3] unless options.key? :port
|
||||||
end
|
end
|
||||||
|
|
||||||
protocol = normalize_protocol protocol
|
protocol = normalize_protocol protocol
|
||||||
|
@ -91,7 +92,7 @@ module ActionDispatch
|
||||||
end
|
end
|
||||||
|
|
||||||
result << host
|
result << host
|
||||||
normalize_port(options[:port], protocol) { |port|
|
normalize_port(port, protocol) { |port|
|
||||||
result << ":#{port}"
|
result << ":#{port}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue