We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3327dd4 commit ba1c685Copy full SHA for ba1c685
actionpack/lib/action_dispatch/http/url.rb
@@ -122,12 +122,13 @@ def normalize_host(_host, options)
122
tld_length = options[:tld_length] || @@tld_length
123
124
host = ""
125
- if options[:subdomain] == true || !options.key?(:subdomain)
+ subdomain = options[:subdomain]
126
+ if subdomain == true || !options.key?(:subdomain)
127
return _host if options[:domain].nil?
128
129
host << extract_subdomain(_host, tld_length).to_param
- elsif options[:subdomain].present?
130
- host << options[:subdomain].to_param
+ elsif subdomain
131
+ host << subdomain.to_param
132
end
133
host << "." unless host.empty?
134
host << (options[:domain] || extract_domain(_host, tld_length))
0 commit comments