diff --git a/lib/fog/connection.rb b/lib/fog/connection.rb index ab451b3a1..cf1294498 100644 --- a/lib/fog/connection.rb +++ b/lib/fog/connection.rb @@ -56,12 +56,11 @@ unless Fog.mocking? if params[:body] if params[:body].is_a?(String) - body = StringIO.new(params[:body]) + connection.write(params[:body]) else - body = params[:body] - end - while chunk = body.read(CHUNK_SIZE) - connection.write(chunk) + while chunk = params[:body].read(CHUNK_SIZE) + connection.write(chunk) + end end end