Permalink
Browse files

Merge pull request #12276 from kennyj/fix_12269

Fix an issue where router can't recognize downcased url encoding path.
Conflicts:
	actionpack/CHANGELOG.md
  • Loading branch information...
rafaelfranca committed Sep 18, 2013
1 parent c8eb823 commit b52b0bebd147de43a8cc118f4d3c0e82b39fe77e
View
@@ -1,5 +1,11 @@
## unreleased ##
+* 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.
@@ -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
@@ -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

0 comments on commit b52b0be

Please sign in to comment.