From fcbca6e59dfa54d424f262929ca9be46abc36939 Mon Sep 17 00:00:00 2001 From: Hannes Georg Date: Wed, 16 Apr 2014 16:28:38 +0200 Subject: [PATCH] Use BUFFER_SIZE instead of nil in Response::Body#readpartial This caused the underlying method to raise an ArgumentError when using each. --- lib/http/response/body.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/http/response/body.rb b/lib/http/response/body.rb index 8b84be43..f94ec791 100644 --- a/lib/http/response/body.rb +++ b/lib/http/response/body.rb @@ -1,4 +1,5 @@ require 'forwardable' +require 'http/client' module HTTP class Response @@ -15,7 +16,7 @@ def initialize(client) end # Read up to length bytes, but return any data that's available - def readpartial(length = nil) + def readpartial(length = Client::BUFFER_SIZE) stream! @client.readpartial(length) end