diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-03-22 17:44:38 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 17:44:38 -0400 |
commit | e26424a74092ba278c7744bbccdbc97a080693cc (patch) | |
tree | 6b9bfcbd2565681de4abaa8455fa1e7151008a13 /actionpack/test | |
parent | ba4bdc536b9241a374673a5a0e67feeff3532964 (diff) | |
parent | 2ef145883348e92c9e6393ece9b6967e3a5a80c7 (diff) | |
download | rails-e26424a74092ba278c7744bbccdbc97a080693cc.tar.gz rails-e26424a74092ba278c7744bbccdbc97a080693cc.tar.bz2 rails-e26424a74092ba278c7744bbccdbc97a080693cc.zip |
Merge pull request #32316 from rails/fix-non-ascii-static-file-serving
Use ASCII-8BIT paths in ActionDispatch::Static
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/static_test.rb | 11 | ||||
-rw-r--r-- | actionpack/test/fixtures/public/foo/さようなら.html | 1 | ||||
-rw-r--r-- | actionpack/test/fixtures/public/foo/さようなら.html.gz | bin | 0 -> 67 bytes | |||
-rw-r--r-- | actionpack/test/fixtures/公共/foo/さようなら.html | 1 | ||||
-rw-r--r-- | actionpack/test/fixtures/公共/foo/さようなら.html.gz | bin | 0 -> 67 bytes |
5 files changed, 12 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/static_test.rb b/actionpack/test/dispatch/static_test.rb index 0bdff68692..6b69cd9999 100644 --- a/actionpack/test/dispatch/static_test.rb +++ b/actionpack/test/dispatch/static_test.rb @@ -71,7 +71,16 @@ module StaticTests end def test_served_static_file_with_non_english_filename - assert_html "means hello in Japanese\n", get("/foo/#{Rack::Utils.escape("こんにちは.html")}") + assert_html "means hello in Japanese\n", get("/foo/%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF.html") + end + + def test_served_gzipped_static_file_with_non_english_filename + response = get("/foo/%E3%81%95%E3%82%88%E3%81%86%E3%81%AA%E3%82%89.html", "HTTP_ACCEPT_ENCODING" => "gzip") + + assert_gzip "/foo/さようなら.html", response + assert_equal "text/html", response.headers["Content-Type"] + assert_equal "Accept-Encoding", response.headers["Vary"] + assert_equal "gzip", response.headers["Content-Encoding"] end def test_serves_static_file_with_exclamation_mark_in_filename diff --git a/actionpack/test/fixtures/public/foo/さようなら.html b/actionpack/test/fixtures/public/foo/さようなら.html new file mode 100644 index 0000000000..627bb2469f --- /dev/null +++ b/actionpack/test/fixtures/public/foo/さようなら.html @@ -0,0 +1 @@ +means goodbye in Japanese diff --git a/actionpack/test/fixtures/public/foo/さようなら.html.gz b/actionpack/test/fixtures/public/foo/さようなら.html.gz Binary files differnew file mode 100644 index 0000000000..4f484cfe86 --- /dev/null +++ b/actionpack/test/fixtures/public/foo/さようなら.html.gz diff --git a/actionpack/test/fixtures/公共/foo/さようなら.html b/actionpack/test/fixtures/公共/foo/さようなら.html new file mode 100644 index 0000000000..627bb2469f --- /dev/null +++ b/actionpack/test/fixtures/公共/foo/さようなら.html @@ -0,0 +1 @@ +means goodbye in Japanese diff --git a/actionpack/test/fixtures/公共/foo/さようなら.html.gz b/actionpack/test/fixtures/公共/foo/さようなら.html.gz Binary files differnew file mode 100644 index 0000000000..4f484cfe86 --- /dev/null +++ b/actionpack/test/fixtures/公共/foo/さようなら.html.gz |