aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-10-04 02:26:40 -0700
committerJosé Valim <jose.valim@gmail.com>2011-10-04 02:26:40 -0700
commitb039069756d7ac6cc9d9096c9e4f98fdcd6a9b33 (patch)
treeaa1b52c692245d07915ce2c4daa2d4e60518ca5b /actionpack/lib/action_dispatch/http
parent7f1a666db57983814e175cb5b54bb6621ec95c4f (diff)
parentde942e5534a26942e261a7699adc28597c5ad1bc (diff)
downloadrails-b039069756d7ac6cc9d9096c9e4f98fdcd6a9b33.tar.gz
rails-b039069756d7ac6cc9d9096c9e4f98fdcd6a9b33.tar.bz2
rails-b039069756d7ac6cc9d9096c9e4f98fdcd6a9b33.zip
Merge pull request #3209 from ksob/subdomain_false_strips_subdomains
:subdomain => false will remove all subdomains now. Closes #2025
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r--actionpack/lib/action_dispatch/http/url.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb
index caa1decb9e..0db404957b 100644
--- a/actionpack/lib/action_dispatch/http/url.rb
+++ b/actionpack/lib/action_dispatch/http/url.rb
@@ -64,13 +64,15 @@ module ActionDispatch
end
def host_or_subdomain_and_domain(options)
- return options[:host] unless options[:subdomain] || options[:domain]
+ return options[:host] unless options[:subdomain] || options[:subdomain] == false || options[:domain]
tld_length = options[:tld_length] || @@tld_length
host = ""
- host << (options[:subdomain] || extract_subdomain(options[:host], tld_length))
- host << "."
+ unless options[:subdomain] == false
+ host << (options[:subdomain] || extract_subdomain(options[:host], tld_length))
+ host << "."
+ end
host << (options[:domain] || extract_domain(options[:host], tld_length))
host
end