Skip to content

Commit

Permalink
Add test for 204 no content response body.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 28, 2024
1 parent da9095e commit e4271a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/protocol/http1/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@
expect(client.read_response_body("GET", 100, {'content-length' => '10'})).to be_nil
end

it "should ignore body for no content responses" do
expect(client.read_response_body("GET", 204, {})).to be_nil
end

it "should handle non-chunked transfer-encoding" do
body = client.read_response_body("GET", 200, {'transfer-encoding' => ['identity']})
expect(body).to be_a(::Protocol::HTTP1::Body::Remainder)
Expand Down

0 comments on commit e4271a1

Please sign in to comment.