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

Don't use last_modified when loading the body

Port of https://github.com/fog/fog-google/pull/545 where:
- last_modified condition was removed
- method has been rewritten to be simpler
This commit is contained in:
David Fernandez 2021-10-29 15:41:27 +02:00 committed by GitHub
parent ab04b45b78
commit 866f0ce3cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,15 +108,16 @@ module Fog
# @return [File]
#
def body
return attributes[:body] if attributes[:body]
return '' unless last_modified
return attributes[:body] if attributes.key?(:body)
file = collection.get(identity)
if file
attributes[:body] = file.body
else
attributes[:body] = ''
end
attributes[:body] =
if file
file.body
else
''
end
end
# Set body attribute.