mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add failing spec on utf8 filename with percent character
This commit is contained in:
parent
7a3ca69959
commit
b5ae1be2cd
2 changed files with 21 additions and 0 deletions
|
@ -63,6 +63,17 @@ class MultipartParamsParsingTest < ActionDispatch::IntegrationTest
|
|||
assert_equal 'contents', file.read
|
||||
end
|
||||
|
||||
test "parses utf8 filename with percent character" do
|
||||
params = parse_multipart('utf8_filename')
|
||||
assert_equal %w(file foo), params.keys.sort
|
||||
assert_equal 'bar', params['foo']
|
||||
|
||||
file = params['file']
|
||||
assert_equal 'ファイル%名.txt', file.original_filename
|
||||
assert_equal "text/plain", file.content_type
|
||||
assert_equal 'contents', file.read
|
||||
end
|
||||
|
||||
test "parses boundary problem file" do
|
||||
params = parse_multipart('boundary_problem_file')
|
||||
assert_equal %w(file foo), params.keys.sort
|
||||
|
|
10
actionpack/test/fixtures/multipart/utf8_filename
vendored
Normal file
10
actionpack/test/fixtures/multipart/utf8_filename
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
--AaB03x
|
||||
Content-Disposition: form-data; name="foo"
|
||||
|
||||
bar
|
||||
--AaB03x
|
||||
Content-Disposition: form-data; name="file"; filename="ファイル%名.txt"
|
||||
Content-Type: text/plain
|
||||
|
||||
contents
|
||||
--AaB03x--
|
Loading…
Reference in a new issue