File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ def call(env)
1616 env [ :body ] = encode_body env [ :body ] unless env [ :body ] . respond_to? ( :to_str )
1717 else
1818 # Ensure valid body for put and post requests
19- env [ :body ] = encode_body ( { } )
19+ if [ :put , :patch , :post ] . include? env [ :method ]
20+ env [ :body ] = encode_body ( { } )
21+ end
2022 end
2123 @app . call env
2224 end
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ def result_type() result[:request_headers]['Content-Type'] end
1919 let ( :result ) { process ( nil ) }
2020
2121 it "returns empty object" do
22- expect ( result_body ) . to eq ( '{}' )
22+ expect ( result_body ) . to be_nil
2323 end
2424
2525 it "doesn't add content type" do
@@ -31,7 +31,7 @@ def result_type() result[:request_headers]['Content-Type'] end
3131 let ( :result ) { process ( '' ) }
3232
3333 it "returns empty object" do
34- expect ( result_body ) . to eq ( '{} ' )
34+ expect ( result_body ) . to eq ( '' )
3535 end
3636
3737 it "doesn't add content type" do
You can’t perform that action at this time.
0 commit comments