lib/rspec/request_describer.rb in rspec-request_describer-0.3.0 vs lib/rspec/request_describer.rb in rspec-request_describer-0.3.1
- old
+ new
@@ -31,10 +31,10 @@
params: request_body
)
end
let(:request_body) do
- if env['CONTENT_TYPE'] == 'application/json'
+ if headers.any? { |key, value| key.to_s.casecmp('content-type').zero? && value == 'application/json' }
params.to_json
else
params.inject({}) do |result, (key, value)|
result.merge(key.to_s => value)
end