diff options
author | Bradford Folkens <bfolkens@gmail.com> | 2011-11-08 07:52:35 -0600 |
---|---|---|
committer | Bradford Folkens <bfolkens@gmail.com> | 2011-11-08 07:52:35 -0600 |
commit | bd559b00680b6e4c272d4df36f239768750f1a6b (patch) | |
tree | 32df3d9688aa2e334c4038354606245107cd57b2 /actionpack/lib/action_dispatch | |
parent | 1347665d89d3efb2047b5d872b3ac1e2e132f159 (diff) | |
download | rails-bd559b00680b6e4c272d4df36f239768750f1a6b.tar.gz rails-bd559b00680b6e4c272d4df36f239768750f1a6b.tar.bz2 rails-bd559b00680b6e4c272d4df36f239768750f1a6b.zip |
Fix trouble using :subdomain in development environment when using numeric addresses.
See-also pull request #3561 from 3-1-stable
Otherwise the following occurs:
TypeError: can't convert nil into String
/Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/http/url.rb:75:in host_or_subdomain_and_domain'
/Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/http/url.rb:37:in url_for'
/Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/routing/url_for.rb:147:in test_subdomain_may_be_accepted_with_numeric_host'
/Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/testing/setup_and_teardown.rb:67:in run'
/Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/callbacks.rb:426:in send'
/Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/callbacks.rb:81:in run'
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/url.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb index c8ddd07bfa..129a8b1031 100644 --- a/actionpack/lib/action_dispatch/http/url.rb +++ b/actionpack/lib/action_dispatch/http/url.rb @@ -64,7 +64,7 @@ module ActionDispatch end def host_or_subdomain_and_domain(options) - return options[:host] if options[:subdomain].nil? && options[:domain].nil? + return options[:host] if !named_host?(options[:host]) || (options[:subdomain].nil? && options[:domain].nil?) tld_length = options[:tld_length] || @@tld_length |