Permalink
Browse files

Properly decode chunked responses with UTF8 characters

  • Loading branch information...
1 parent 8f89432 commit 5cff4290de94fc00a2e3962e3ef5240012cddce9 @gjacobrobertson gjacobrobertson committed Jun 5, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/httpclient/session.rb
@@ -984,10 +984,11 @@ def read_body_chunked(&block)
return
end
timeout(@receive_timeout, ReceiveTimeoutError) do
- @socket.read(@chunk_length + 2, buf)
+ @socket.read(@chunk_length, buf)
+ @socket.read(2)
end
unless buf.empty?
- yield buf.slice(0, @chunk_length)
+ yield buf
end
end
end

0 comments on commit 5cff429

Please sign in to comment.