mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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
This commit is contained in:
@@ -78,7 +78,7 @@ module ActionController
|
||||
end
|
||||
|
||||
def path_info
|
||||
env['PATH_INFO']
|
||||
(/^(.*)\.html$/ =~ env['PATH_INFO']) ? $1 : env['PATH_INFO']
|
||||
end
|
||||
|
||||
def protocol
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user