X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/8379b6517454ccbdd1b408a09fade7644403785f..f02c753cc4ab882537ac75065c6c65605e8dc9fe:/config/initializers/streaming.rb diff --git a/config/initializers/streaming.rb b/config/initializers/streaming.rb deleted file mode 100644 index 0c27ba2e7..000000000 --- a/config/initializers/streaming.rb +++ /dev/null @@ -1,23 +0,0 @@ -# Hack ActionController::DataStreaming to allow streaming from a file handle -module ActionController - module DataStreaming - alias old_send_file send_file - - def send_file(file, options = {}) - 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] - send_file_headers! options - - self.status = options[:status] || 200 - self.content_type = options[:content_type] if options.key?(:content_type) - self.response_body = file - else - headers["Content-Length"] ||= File.size(file).to_s - - old_send_file(file, options) - end - end - end -end