lib/plezi/controller/controller.rb in plezi-0.14.2 vs lib/plezi/controller/controller.rb in plezi-0.14.3

- old
+ new

@@ -91,9 +91,10 @@ # set headers content_disposition = options[:inline] ? 'inline'.dup : 'attachment'.dup content_disposition << "; filename=#{::File.basename(options[:filename])}" if options[:filename] response['content-type'.freeze] = (options[:mime] ||= options[:filename] && Rack::Mime.mime_type(::File.extname(options[:filename]))) + response.delete('content-type'.freeze) unless response['content-type'.freeze] response['content-disposition'.freeze] = content_disposition true end # Same as {#send_data}, but accepts a file name (to be opened and sent) rather then a String.