Skip to content

Commit 36e18d8

Browse files
author
Shinya Maeda
committed
Remove condition of content_type
1 parent 83631f4 commit 36e18d8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/fog/storage/google_json/requests/put_object.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,9 @@ def put_object(bucket_name,
4848
**options)
4949
if data.is_a?(String)
5050
data = StringIO.new(data)
51-
end
52-
53-
unless options[:content_type]
54-
options[:content_type] = "text/plain"
55-
56-
if data.is_a?(::File)
57-
options[:content_type] = Fog::Storage.parse_data(data)[:headers]["Content-Type"]
58-
end
51+
options[:content_type] ||= "text/plain"
52+
elsif data.is_a?(::File)
53+
options[:content_type] ||= Fog::Storage.parse_data(data)[:headers]["Content-Type"]
5954
end
6055

6156
# Paperclip::AbstractAdapter

0 commit comments

Comments
 (0)