Permalink
Browse files

Merge pull request #175 from jsherwood0/master

Make session.rb ignore negative content length
  • Loading branch information...
2 parents bebc63c + ff61cef commit 956fa55d1679e10f226883c054bd4f92907c4e9a @nahi committed Dec 2, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/httpclient/session.rb
View
2 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 956fa55

Please sign in to comment.