diff options
author | eileencodes <eileencodes@gmail.com> | 2017-05-12 14:12:40 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2017-05-12 14:14:01 -0400 |
commit | 8607c25ba7810573733d9b37d0015154ba059f5e (patch) | |
tree | 696a9c807273e8a414c4a634f86e8ac421b67d03 /actionpack/test/journey | |
parent | 943efa30f5475f51fe90df5f85703d191dbd7d6e (diff) | |
download | rails-8607c25ba7810573733d9b37d0015154ba059f5e.tar.gz rails-8607c25ba7810573733d9b37d0015154ba059f5e.tar.bz2 rails-8607c25ba7810573733d9b37d0015154ba059f5e.zip |
Maintain original encoding from path
When the path info is read from the socket it's encoded as ASCII 8BIT.
The unescape method changes the encoding to UTF8 but it should maintain
the encoding of the string that's passed in.
This causes parameters to be force encoded to UTF8 when we don't
actually know what the encoding of the parameter should be.
Diffstat (limited to 'actionpack/test/journey')
-rw-r--r-- | actionpack/test/journey/router/utils_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/journey/router/utils_test.rb b/actionpack/test/journey/router/utils_test.rb index b77bf6628a..74277a4325 100644 --- a/actionpack/test/journey/router/utils_test.rb +++ b/actionpack/test/journey/router/utils_test.rb @@ -31,6 +31,11 @@ module ActionDispatch def test_normalize_path_uppercase assert_equal "/foo%AAbar%AAbaz", Utils.normalize_path("/foo%aabar%aabaz") end + + def test_normalize_path_maintains_string_encoding + path = "/foo%AAbar%AAbaz".b + assert_equal Encoding::ASCII_8BIT, Utils.normalize_path(path).encoding + end end end end |