Skip to content

Commit

Permalink
Properly decode chunked responses with UTF8 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
gjacobrobertson committed Jun 5, 2013
1 parent 8f89432 commit 5cff429
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/httpclient/session.rb
Expand Up @@ -984,10 +984,11 @@ def read_body_chunked(&block)
return return
end end
timeout(@receive_timeout, ReceiveTimeoutError) do timeout(@receive_timeout, ReceiveTimeoutError) do
@socket.read(@chunk_length + 2, buf) @socket.read(@chunk_length, buf)
@socket.read(2)
end end
unless buf.empty? unless buf.empty?
yield buf.slice(0, @chunk_length) yield buf
end end
end end
end end
Expand Down

0 comments on commit 5cff429

Please sign in to comment.