Permalink
Browse files

Make session.rb ignore negative content length

  • Loading branch information...
1 parent bebc63c commit ff61ceffac780f70aab1a81f1c7598371bfbd4b5 @jsherwood0 jsherwood0 committed Aug 7, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/httpclient/session.rb
@@ -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)

0 comments on commit ff61cef

Please sign in to comment.