thumbor-community / aws

Thumbor AWS extensions
MIT License
155 stars 70 forks source link

Explicitly set content type when uploading to S3 #92

Closed nbolender closed 7 years ago

nbolender commented 7 years ago

S3 was defaulting to application/octet-stream on all files uploaded. So if you hit S3 directly from a browser, the image downloads.

This PR explicitly sets the content type when uploading to S3.

I am using this in a scenario where I have Cloudfront using an S3 static website as the origin instead of Thumbor directly. S3 is configured to redirect 404 errors to the actual Thumbor server. This way, cached result images can be served directly by S3 and Cloudfront.

kkopachev commented 7 years ago

@nbolender how do you handle webp paths from CloudFront?

nbolender commented 7 years ago

@kkopachev I'm not using webp images, but I'm sure it is possible.

Bladrak commented 7 years ago

Released under 6.0.4

Bladrak commented 7 years ago

Thanks for the contribution :)