diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/url.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index 92aba01b95..fd310d5219 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -13,7 +13,7 @@ module ActionDispatch class << self def extract_domain(host, tld_length) - host.split('.').last(1 + tld_length).join('.') if named_host?(host) + extract_domain_from(host, tld_length) if named_host?(host) end def extract_subdomains(host, tld_length) @@ -60,6 +60,10 @@ module ActionDispatch private + def extract_domain_from(host, tld_length) + host.split('.').last(1 + tld_length).join('.') + end + def add_trailing_slash(path) # includes querysting if path.include?('?') @@ -131,7 +135,7 @@ module ActionDispatch host << subdomain.to_param end host << "." unless host.empty? - host << (options[:domain] || extract_domain(_host, tld_length)) + host << (options[:domain] || extract_domain_from(_host, tld_length)) host end |