hooktstudios/capistrano-s3 — pull request #12 by douglasjarquin (2013-04-01 15:24:33+00:00)
Title: Pass a string to the content_type option

We noticed that css files were getting their "Content-Type" header set as empty. This isn't a problem with modern browsers, but IE won't play nice.

Experimenting with how to get the mime type of a file, since there are a lots of ways, we ended up using `types.first.content_type` instead of `types[0]`. This returns a string, instead of an object, which for whatever reason fixes the issue. All other content types are still set as expected.

Tested against `ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]`.

## Output Examples

Before:

```
I, [2013-04-01T11:20:03.782420 #11532] INFO -- : [AWS S3 200 0.183128 0 retries] put_object(:acl=>"private",:bucket_name=>"staging.greatcaloriedrive.com",:content_length=>723,:content_type=>#,:data=>#,:key=>"en/styles/en.css")
```

After:

```
I, [2013-04-01T11:21:19.602401 #11642] INFO -- : [AWS S3 200 0.195902 0 retries] put_object(:acl=>"private",:bucket_name=>"staging.greatcaloriedrive.com",:content_length=>723,:content_type=>"text/css",:data=>#,:key=>"en/styles/en.css")
```