X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/afeee2923ff8340e4d9b8027a0d32b26bfcef17f..366a9e9097e6b8ca19cd3ecb2b08db1fbc0e2274:/config/initializers/streaming.rb?ds=sidebyside diff --git a/config/initializers/streaming.rb b/config/initializers/streaming.rb index db61e6b24..0c27ba2e7 100644 --- a/config/initializers/streaming.rb +++ b/config/initializers/streaming.rb @@ -1,10 +1,10 @@ # Hack ActionController::DataStreaming to allow streaming from a file handle module ActionController module DataStreaming - alias_method :old_send_file, :send_file + alias old_send_file send_file def send_file(file, options = {}) - if file.is_a? File or file.is_a? Tempfile + if file.is_a?(File) || file.is_a?(Tempfile) headers["Content-Length"] ||= file.size.to_s options[:filename] ||= File.basename(file.path) unless options[:url_based_filename]