Commit aebbb7c4 by Jon Yurek

S3 uploads should have their content types set

parent f756dd1d
...@@ -165,7 +165,7 @@ module Paperclip ...@@ -165,7 +165,7 @@ module Paperclip
logger.info("[paperclip] -> #{path(style)}") logger.info("[paperclip] -> #{path(style)}")
key = s3_bucket.key(path(style)) key = s3_bucket.key(path(style))
key.data = file key.data = file
key.put(nil, @s3_permissions) key.put(nil, @s3_permissions, {'Content-type' => instance_read(:content_type)})
rescue RightAws::AwsError => e rescue RightAws::AwsError => e
raise raise
end end
......
...@@ -97,7 +97,7 @@ class StorageTest < Test::Unit::TestCase ...@@ -97,7 +97,7 @@ class StorageTest < Test::Unit::TestCase
@key_mock = stub @key_mock = stub
@bucket_mock.expects(:key).returns(@key_mock) @bucket_mock.expects(:key).returns(@key_mock)
@key_mock.expects(:data=) @key_mock.expects(:data=)
@key_mock.expects(:put) @key_mock.expects(:put).with(nil, 'public-read', 'Content-type' => 'image/png')
@dummy.save @dummy.save
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment