mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
fix ArgumentError being raised in case of invalid byte sequences
This commit is contained in:
@@ -38,6 +38,7 @@ module ActionDispatch
|
||||
end
|
||||
|
||||
def escape_glob_chars(path)
|
||||
path.force_encoding('binary') if path.respond_to? :force_encoding
|
||||
path.gsub(/[*?{}\[\]]/, "\\\\\\&")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,6 +6,10 @@ module StaticTests
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user