diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-11-06 16:36:10 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-11-06 16:36:10 +0000 |
commit | 9a8d583a910f81bc9241ed19abc6e01b4728a766 (patch) | |
tree | f24ca7296351849138470d1d6ca78704e707eb40 /actionpack/test/controller | |
parent | fdc767d4477ff94c6a8dea94905b100c8d8fcd12 (diff) | |
download | rails-9a8d583a910f81bc9241ed19abc6e01b4728a766.tar.gz rails-9a8d583a910f81bc9241ed19abc6e01b4728a766.tar.bz2 rails-9a8d583a910f81bc9241ed19abc6e01b4728a766.zip |
Fixed that ActionController::CgiRequest#host_with_port() should handle standard port (closes #10082) [moro]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8088 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rwxr-xr-x | actionpack/test/controller/cgi_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb index fe94d7c7a6..cf9d5d163e 100755 --- a/actionpack/test/controller/cgi_test.rb +++ b/actionpack/test/controller/cgi_test.rb @@ -47,6 +47,17 @@ class CgiRequestTest < BaseCgiTest assert_equal "207.7.108.53:8007", @request.host_with_port end + def test_host_with_port_if_http_standard_port_is_specified + @request_hash['HTTP_X_FORWARDED_HOST'] = "glu.ttono.us:80" + assert_equal "glu.ttono.us", @request.host_with_port + end + + def test_host_with_port_if_https_standard_port_is_specified + @request_hash['HTTP_X_FORWARDED_PROTO'] = "https" + @request_hash['HTTP_X_FORWARDED_HOST'] = "glu.ttono.us:443" + assert_equal "glu.ttono.us", @request.host_with_port + end + def test_host_if_ipv6_reference @request_hash.delete "HTTP_X_FORWARDED_HOST" @request_hash['HTTP_HOST'] = "[2001:1234:5678:9abc:def0::dead:beef]" |