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:
parent
77e9013a44
commit
123d3041f4
1 changed files with 4 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue