Amazon S3 content type problems with Transmit

When I recently used Transmit (4.1.7) to upload Rails assets to Amazon S3 I ran into an issue where the CSS files were being loaded, but the styles weren’t being applied. Attempting to access the CSS directly would download the file instead of displaying it in the browser.

A quick check on Google led me to the answer – S3 was returning the wrong content-type headers.

Transmit actually has a feature for this, go to Preferences > Cloud and you can customize headers by file type. I added Extension: css, Name: content-type, Value: text/css and re-uploaded my CSS files (then set the permissions to Read: World) and the styles are now being parsed correctly.