summaryrefslogtreecommitdiff
path: root/test/spec_multipart.rb
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-01-17 09:09:14 -0800
committerJeremy Evans <code@jeremyevans.net>2020-01-17 09:27:25 -0800
commitd5aa5ac532fa2b553ee387175b9bad274a59f1de (patch)
tree54db69b4799f84f3a0882d7ee9ada130bf0cae5d /test/spec_multipart.rb
parentba2b9b4cce6c7a4a8e64b128bb7b5af95e01ba4e (diff)
downloadrack-d5aa5ac532fa2b553ee387175b9bad274a59f1de.tar.gz
Add test for multipart parsing without Content-Disposition
In this case, rack doesn't have a parameter name, so it uses the content type as the parameter name. Since there can be multiple parts without Content-Disposition, it uses an array. Fixes #984
Diffstat (limited to 'test/spec_multipart.rb')
-rw-r--r--test/spec_multipart.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/spec_multipart.rb b/test/spec_multipart.rb
index 2d51f091..9f4616aa 100644
--- a/test/spec_multipart.rb
+++ b/test/spec_multipart.rb
@@ -30,6 +30,12 @@ describe Rack::Multipart do
Rack::Multipart.parse_multipart(env).must_be_nil
end
+ it "parse multipart content when content type present but disposition is not" do
+ env = Rack::MockRequest.env_for("/", multipart_fixture(:content_type_and_no_disposition))
+ params = Rack::Multipart.parse_multipart(env)
+ params["text/plain; charset=US-ASCII"].must_equal ["contents"]
+ end
+
it "parse multipart content when content type present but filename is not" do
env = Rack::MockRequest.env_for("/", multipart_fixture(:content_type_and_no_filename))
params = Rack::Multipart.parse_multipart(env)