igor-alexandrov/paperclip-aws — pull request #10 by mmzoo (2012-02-24 12:02:10+00:00)
Title: Ensuring that there is no newline at the end of the file content type

I noticed that on some systems, a newline will be added to content_type, which causes the following error:

```ruby
put_object(:acl=>"public-read",:bucket_name=>"mybucket",
:content_disposition=>nil,
:content_type=>"image/jpeg\n", # <<<---- Here's the problem
:file=>"/tmp/stream2012-12012-0",:key=>"path/to/image.jpg",
:server_side_encryption=>false,
:storage_class=>:standard)
AWS::S3::Errors::SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
```

I noticed that everywhere in the Paperclip libs (https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/attachment.rb#L113) they do the same thing.