Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix ArgumentError being raised in case of invalid byte sequences

  • Loading branch information...
commit 7d5fbf846b432821d0179553fa902d2de9372172 1 parent efc0d03
@mreinsch mreinsch authored
View
1  actionpack/lib/action_dispatch/middleware/static.rb
@@ -39,6 +39,7 @@ def unescape_path(path)
end
def escape_glob_chars(path)
+ path.force_encoding('binary') if path.respond_to? :force_encoding
path.gsub(/[*?{}\[\]]/, "\\\\\\&")
end
end
View
4 actionpack/test/dispatch/static_test.rb
@@ -7,6 +7,10 @@ def test_serves_dynamic_content
assert_equal "Hello, World!", get("/nofile").body
end
+ def test_handles_urls_with_bad_encoding
+ assert_equal "Hello, World!", get("/doorkeeper%E3E4").body
+ end
+
def test_sets_cache_control
response = get("/index.html")
assert_html "/index.html", response
Please sign in to comment.
Something went wrong with that request. Please try again.