Skip to content
Browse files

only pull :protocol from the options hash once

  • Loading branch information...
1 parent aaaff36 commit ec1caddb7f93a4277a6ab0727b2c41b34cafbfa5 @tenderlove tenderlove committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 actionpack/lib/action_dispatch/http/url.rb
View
5 actionpack/lib/action_dispatch/http/url.rb
@@ -73,13 +73,14 @@ def add_trailing_slash(path)
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

0 comments on commit ec1cadd

Please sign in to comment.
Something went wrong with that request. Please try again.