diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-01 02:04:54 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-01 02:04:54 +0000 |
commit | 28a11969ced52abf3d7d51f486779cf31d1efe1f (patch) | |
tree | 34ab22fda9a57519727956778f5be585115a917f /actionpack | |
parent | a29625fc801482229948155e8735cb163ded3916 (diff) | |
download | rails-28a11969ced52abf3d7d51f486779cf31d1efe1f.tar.gz rails-28a11969ced52abf3d7d51f486779cf31d1efe1f.tar.bz2 rails-28a11969ced52abf3d7d51f486779cf31d1efe1f.zip |
Fix request.path_info and clear up LoadingModule behavior #754 [Nicholas Seckar]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@817 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/request_test.rb | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index 16117a6079..75b7c62378 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -78,7 +78,7 @@ module ActionController end def path_info - env['PATH_INFO'] + (/^(.*)\.html$/ =~ env['PATH_INFO']) ? $1 : env['PATH_INFO'] end def protocol diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb index 82a1d6bb70..513828462e 100644 --- a/actionpack/test/controller/request_test.rb +++ b/actionpack/test/controller/request_test.rb @@ -58,6 +58,11 @@ class RequestTest < Test::Unit::TestCase @request.env["PATH_INFO"] = "/path/of/some/uri" assert_equal "/path/of/some/uri", @request.path_info assert_equal "/path/of/some/uri", @request.path + + # PATH_INFO actually has a .html suffix on many servers. But we don't want Rails to see the .html part. + @request.env["PATH_INFO"] = "/path/of/some/uri.html" + assert_equal "/path/of/some/uri", @request.path_info + assert_equal "/path/of/some/uri", @request.path end def test_host_with_port |