Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Correct error in Utils.normalize_path that changed paths improperly

  • Loading branch information...
commit cb81a535e0ea7de890a7d65982364c4e7c6ba254 1 parent ec3ad30
Josh Symonds Veraticus authored
2  actionpack/lib/action_dispatch/journey/router/utils.rb
View
@@ -18,7 +18,7 @@ def self.normalize_path(path)
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
8 actionpack/test/journey/router/utils_test.rb
View
@@ -15,6 +15,14 @@ def test_fragment_escape
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
Please sign in to comment.
Something went wrong with that request. Please try again.