Commit eb928346 by Nathan Benes Committed by Mike Burns

Rack gets a newline at the end of the content_type in certain instances:…

Rack gets a newline at the end of the content_type in certain instances: 'image/jpeg\r' which causes S3 to be unable to accept the file. Fixes #817
parent 45bf52aa
...@@ -15,7 +15,7 @@ module Paperclip ...@@ -15,7 +15,7 @@ module Paperclip
def cache_current_values def cache_current_values
@original_filename = @target.original_filename @original_filename = @target.original_filename
@content_type = @target.content_type @content_type = @target.content_type.to_s.strip
@size = File.size(@target.path) @size = File.size(@target.path)
end end
end end
......
...@@ -10,7 +10,7 @@ class UploadedFileAdapterTest < Test::Unit::TestCase ...@@ -10,7 +10,7 @@ class UploadedFileAdapterTest < Test::Unit::TestCase
@file = UploadedFile.new( @file = UploadedFile.new(
:original_filename => "5k.png", :original_filename => "5k.png",
:content_type => "image/png", :content_type => "image/png\r",
:head => "", :head => "",
:tempfile => tempfile, :tempfile => tempfile,
:path => tempfile.path :path => tempfile.path
......
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