Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix an issue where router can't recognize downcased url encoding path.

  • Loading branch information...
commit 0cc65081200fe93acf0058829bb9dd7c41e59e9d 1 parent 949c429
@kennyj kennyj authored
View
6 actionpack/CHANGELOG.md
@@ -1,3 +1,9 @@
+* Fix an issue where router can't recognize downcased url encoding path.
+
+ Fixes #12269
+
+ *kennyj*
+
* Fix custom flash type definition. Misusage of the `_flash_types` class variable
caused an error when reloading controllers with custom flash types.
View
1  actionpack/lib/action_dispatch/journey/router/utils.rb
@@ -16,6 +16,7 @@ def self.normalize_path(path)
path = "/#{path}"
path.squeeze!('/')
path.sub!(%r{/+\Z}, '')
+ path.gsub!(/(%[a-f0-9]{2}+)/) { $1.upcase }
path = '/' if path == ''
path
end
View
4 actionpack/test/controller/routing_test.rb
@@ -1904,6 +1904,10 @@ def test_unicode_path
assert_equal({:controller => 'news', :action => 'index'}, @routes.recognize_path(URI.parser.escape('こんにちは/世界'), :method => :get))
end
+ def test_downcased_unicode_path
+ assert_equal({:controller => 'news', :action => 'index'}, @routes.recognize_path(URI.parser.escape('こんにちは/世界').downcase, :method => :get))
+ end
+
private
def sort_extras!(extras)
if extras.length == 2
Please sign in to comment.
Something went wrong with that request. Please try again.