summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2022-01-25 14:24:07 -0800
committerJeremy Evans <code@jeremyevans.net>2022-01-25 14:35:34 -0800
commit586fc991ac0d55c4b17e97528f79e76ab96a4b2b (patch)
tree12fda08172487655cf5806009ad51f2113a76e2c /test
parentd01c2fd2c8a6fe64d90d908de74b65cddd9ec7ec (diff)
downloadrack-586fc991ac0d55c4b17e97528f79e76ab96a4b2b.tar.gz
Cache Rack::Request#POST result if input content type is not parseable (Fixes #749)
In all other cases, the result was cached, so not caching in this case is inconsistent, and can result in unexpected behavior if POST is called multiple times on the same request.
Diffstat (limited to 'test')
-rw-r--r--test/spec_request.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/spec_request.rb b/test/spec_request.rb
index c2c71dc4..7371823a 100644
--- a/test/spec_request.rb
+++ b/test/spec_request.rb
@@ -434,7 +434,9 @@ class RackRequestTest < Minitest::Spec
req.media_type.must_equal 'text/plain'
req.media_type_params['charset'].must_equal 'utf-8'
req.content_charset.must_equal 'utf-8'
- req.POST.must_be :empty?
+ post = req.POST
+ post.must_be_empty
+ req.POST.must_be_same_as post
req.params.must_equal "foo" => "quux"
req.body.read.must_equal "foo=bar&quux=bla"
end