Skip to content

Commit e4271a1

Browse files
committed
Add test for 204 no content response body.
1 parent da9095e commit e4271a1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/protocol/http1/connection.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@
207207
expect(client.read_response_body("GET", 100, {'content-length' => '10'})).to be_nil
208208
end
209209

210+
it "should ignore body for no content responses" do
211+
expect(client.read_response_body("GET", 204, {})).to be_nil
212+
end
213+
210214
it "should handle non-chunked transfer-encoding" do
211215
body = client.read_response_body("GET", 200, {'transfer-encoding' => ['identity']})
212216
expect(body).to be_a(::Protocol::HTTP1::Body::Remainder)

0 commit comments

Comments
 (0)