We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7c6b63f + 320cdf3 commit ae54a8cCopy full SHA for ae54a8c
lib/fog/storage/google_json/requests/put_object.rb
@@ -46,13 +46,11 @@ def put_object(bucket_name,
46
kms_key_name: nil,
47
predefined_acl: nil,
48
**options)
49
- unless options[:content_type]
50
- if data.is_a?(String)
51
- data = StringIO.new(data)
52
- options[:content_type] = "text/plain"
53
- elsif data.is_a?(::File)
54
- options[:content_type] = Fog::Storage.parse_data(data)[:headers]["Content-Type"]
55
- end
+ if data.is_a?(String)
+ data = StringIO.new(data)
+ options[:content_type] ||= "text/plain"
+ elsif data.is_a?(::File)
+ options[:content_type] ||= Fog::Storage.parse_data(data)[:headers]["Content-Type"]
56
end
57
58
# Paperclip::AbstractAdapter
0 commit comments