diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-18 05:17:18 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-18 05:17:18 +0000 |
commit | 92473b8f961218284340f4d045ba8fe3cbd694b1 (patch) | |
tree | f77a3400cecb5e5b3bbdce6bff8b4c1c18cdbb7e /actionpack/test/controller | |
parent | 959707bfb62108fe9924ed4fefd6f3458972493a (diff) | |
download | rails-92473b8f961218284340f4d045ba8fe3cbd694b1.tar.gz rails-92473b8f961218284340f4d045ba8fe3cbd694b1.tar.bz2 rails-92473b8f961218284340f4d045ba8fe3cbd694b1.zip |
Fixed relative urls support for lighttpd #1048 [Nicholas Seckar/maznawak@nerim.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1450 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/request_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb index 9678e5629b..dd7c9f9d84 100644 --- a/actionpack/test/controller/request_test.rb +++ b/actionpack/test/controller/request_test.rb @@ -66,6 +66,11 @@ class RequestTest < Test::Unit::TestCase end def test_relative_url_root + @request.env['SERVER_SOFTWARE'] = 'lighttpd/1.2.3' + assert_nil @request.relative_url_root, "relative_url_root should be disabled on lighttpd" + + @request.env['SERVER_SOFTWARE'] = 'apache/1.2.3 some random text' + @request.env['SCRIPT_NAME'] = nil assert_equal "", @request.relative_url_root @@ -85,6 +90,8 @@ class RequestTest < Test::Unit::TestCase end def test_request_uri + @request.env['SERVER_SOFTWARE'] = 'Apache 42.342.3432' + @request.relative_url_root = nil @request.set_REQUEST_URI "http://www.rubyonrails.org/path/of/some/uri?mapped=1" assert_equal "/path/of/some/uri?mapped=1", @request.request_uri @@ -193,4 +200,14 @@ class RequestTest < Test::Unit::TestCase @request.port = 81 assert_equal "rubyonrails.org:81", @request.host_with_port end + + def test_server_software + assert_equal nil, @request.server_software + + @request.env['SERVER_SOFTWARE'] = 'Apache3.422' + assert_equal 'apache', @request.server_software + + @request.env['SERVER_SOFTWARE'] = 'lighttpd(1.1.4)' + assert_equal 'lighttpd', @request.server_software + end end |