lib/paperclip/storage/s3.rb in paperclip-2.5.0 vs lib/paperclip/storage/s3.rb in paperclip-2.5.1

- old
+ new

@@ -113,10 +113,12 @@ headers end @s3_headers[:storage_class] = @options[:s3_storage_class] if @options[:s3_storage_class] + @s3_server_side_encryption = @options[:s3_server_side_encryption] + unless @options[:url].to_s.match(/^:s3.*url$/) || @options[:url] == ":asset_host" @options[:path] = @options[:path].gsub(/:url/, @options[:url]).gsub(/^:rails_root\/public\/system/, '') @options[:url] = ":s3_path_url" end @options[:url] = @options[:url].inspect if @options[:url].is_a?(Symbol) @@ -279,9 +281,12 @@ write_options = { :content_type => file.content_type.to_s.strip, :acl => acl } write_options[:metadata] = @s3_metadata unless @s3_metadata.empty? + unless @s3_server_side_encryption.blank? + write_options[:server_side_encryption] = @s3_server_side_encryption + end write_options.merge!(@s3_headers) s3_object(style).write(file, write_options) rescue AWS::S3::Errors::NoSuchBucket => e create_bucket retry