diff --git a/committee.gemspec b/committee.gemspec index 1e39a078..ebdaaad2 100644 --- a/committee.gemspec +++ b/committee.gemspec @@ -22,11 +22,11 @@ Gem::Specification.new do |s| s.add_dependency "json_schema", "~> 0.14", ">= 0.14.3" - s.add_dependency "rack", ">= 1.5" + s.add_dependency "rack", ">= 1.5", "< 3.1" s.add_dependency "openapi_parser", "~> 2.0" s.add_development_dependency "minitest", "~> 5.3" - s.add_development_dependency "rack-test", "~> 0.8" + s.add_development_dependency "rack-test" s.add_development_dependency "rake", "~> 13.1" s.add_development_dependency "pry" s.add_development_dependency "pry-byebug" diff --git a/lib/committee/request_unpacker.rb b/lib/committee/request_unpacker.rb index abddd264..c6293db1 100644 --- a/lib/committee/request_unpacker.rb +++ b/lib/committee/request_unpacker.rb @@ -46,7 +46,11 @@ def unpack_request_params(request) if @allow_form_params && %w[application/x-www-form-urlencoded multipart/form-data].include?(request.media_type) # Actually, POST means anything in the request body, could be from # PUT or PATCH too. Silly Rack. - return [request.POST, true] if request.POST + begin + return [request.POST, true] if request.POST + ensure + request.body.rewind + end end [{}, false]