Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make session.rb ignore negative content length

  • Loading branch information...
commit ff61ceffac780f70aab1a81f1c7598371bfbd4b5 1 parent bebc63c
John Sherwood jsherwood0 authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/httpclient/session.rb
2  lib/httpclient/session.rb
View
@@ -949,7 +949,7 @@ def read_body_length(&block)
while true
buf = empty_bin_str
maxbytes = @read_block_size
- maxbytes = @content_length if maxbytes > @content_length
+ maxbytes = @content_length if maxbytes > @content_length && @content_length > 0
timeout(@receive_timeout, ReceiveTimeoutError) do
begin
@socket.readpartial(maxbytes, buf)
Please sign in to comment.
Something went wrong with that request. Please try again.