1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

simplify connection.write when body is string

This commit is contained in:
Wesley Beary 2009-10-11 13:37:56 -07:00
parent 77e9013a44
commit 123d3041f4

View file

@ -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