Permalink
Browse files

Merge pull request #5338 from mreinsch/3-2-static_invalid_byte_sequence

3 2 static invalid byte sequence
  • Loading branch information...
tenderlove committed Mar 15, 2012
2 parents 9dfb41f + 55cac81 commit f9181377924a77dff328c49f51b6dc66c4705e2b
Showing with 5 additions and 0 deletions.
  1. +1 −0 actionpack/lib/action_dispatch/middleware/static.rb
  2. +4 −0 actionpack/test/dispatch/static_test.rb
@@ -38,6 +38,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
@@ -6,6 +6,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

0 comments on commit f918137

Please sign in to comment.