mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Rescue if IO throws exception on attempted #rewind
This will permit the passing in of pipes, sockets, or other IO objects that throw exceptions when you call the #rewind method.
This commit is contained in:
parent
e656f37ae9
commit
a052af9a92
1 changed files with 3 additions and 1 deletions
|
@ -44,7 +44,9 @@ module Fog
|
|||
|
||||
hash = Fog::AWS::Glacier::TreeHash.new
|
||||
|
||||
body.rewind if body.respond_to?(:rewind)
|
||||
if body.respond_to?(:rewind)
|
||||
body.rewind rescue nil
|
||||
end
|
||||
offset = 0
|
||||
while (chunk = body.read(multipart_chunk_size)) do
|
||||
part_hash = hash.add_part(chunk)
|
||||
|
|
Loading…
Reference in a new issue