1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Correct error in Utils.normalize_path that changed paths improperly

This commit is contained in:
Josh Symonds 2013-10-23 16:44:23 -05:00
parent ec3ad30606
commit cb81a535e0
2 changed files with 9 additions and 1 deletions

View file

@ -18,7 +18,7 @@ module ActionDispatch
path = "/#{path}"
path.squeeze!('/')
path.sub!(%r{/+\Z}, '')
path.gsub!(/(%[a-f0-9]{2}+)/) { $1.upcase }
path.gsub!(/(%[a-f0-9]{2})/) { $1.upcase }
path = '/' if path == ''
path
end

View file

@ -15,6 +15,14 @@ module ActionDispatch
def test_uri_unescape
assert_equal "a/b c+d", Utils.unescape_uri("a%2Fb%20c+d")
end
def test_normalize_path_not_greedy
assert_equal "/foo%20bar%20baz", Utils.normalize_path("/foo%20bar%20baz")
end
def test_normalize_path_uppercase
assert_equal "/foo%AAbar%AAbaz", Utils.normalize_path("/foo%aabar%aabaz")
end
end
end
end