diff options
-rw-r--r-- | actionpack/lib/action_dispatch/http/url.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index 0aa7e3433e..87e76113d6 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -124,11 +124,11 @@ module ActionDispatch return _host unless named_host?(_host) tld_length = options[:tld_length] || @@tld_length - subdomain = options[:subdomain] + subdomain = options.fetch :subdomain, true domain = options[:domain] host = "" - if subdomain == true || !options.key?(:subdomain) + if subdomain == true return _host if domain.nil? host << extract_subdomain(_host, tld_length) |