mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
only pull :protocol from the options hash once
This commit is contained in:
parent
aaaff369da
commit
ec1caddb7f
1 changed files with 3 additions and 2 deletions
|
@ -73,13 +73,14 @@ module ActionDispatch
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_host_url(options)
|
def build_host_url(options)
|
||||||
|
protocol = options[:protocol]
|
||||||
if match = options[:host].match(HOST_REGEXP)
|
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[:host] = match[2]
|
||||||
options[:port] = match[3] unless options.key?(:port)
|
options[:port] = match[3] unless options.key?(:port)
|
||||||
end
|
end
|
||||||
|
|
||||||
protocol = normalize_protocol options[:protocol]
|
protocol = normalize_protocol protocol
|
||||||
options[:host] = normalize_host(options)
|
options[:host] = normalize_host(options)
|
||||||
|
|
||||||
result = protocol.dup
|
result = protocol.dup
|
||||||
|
|
Loading…
Reference in a new issue