Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki
This commit is contained in:
commit
4de9fb9283
2 changed files with 4 additions and 3 deletions
|
@ -87,7 +87,8 @@ class ApplicationController < ActionController::Base
|
||||||
original_options[:type] ||= (FILE_TYPES[File.extname(file_name)] or 'application/octet-stream')
|
original_options[:type] ||= (FILE_TYPES[File.extname(file_name)] or 'application/octet-stream')
|
||||||
original_options[:disposition] ||= (DISPOSITION[original_options[:type]] or 'attachment')
|
original_options[:disposition] ||= (DISPOSITION[original_options[:type]] or 'attachment')
|
||||||
original_options[:stream] ||= false
|
original_options[:stream] ||= false
|
||||||
original_options[:x_sendfile] = true if request.env.include?('HTTP_X_SENDFILE_TYPE') && request.remote_addr == LOCALHOST
|
original_options[:x_sendfile] = true if request.env.include?('HTTP_X_SENDFILE_TYPE') &&
|
||||||
|
( request.remote_addr == LOCALHOST || defined?(PhusionPassenger) )
|
||||||
original_options
|
original_options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ class FileController < ApplicationController
|
||||||
|
|
||||||
layout 'default'
|
layout 'default'
|
||||||
|
|
||||||
before_filter :dnsbl_check, :check_authorized
|
before_filter :check_authorized
|
||||||
before_filter :check_allow_uploads, :except => [:file, :blahtex_png]
|
before_filter :check_allow_uploads, :dnsbl_check, :except => [:file, :blahtex_png]
|
||||||
|
|
||||||
def file
|
def file
|
||||||
@file_name = params['id']
|
@file_name = params['id']
|
||||||
|
|
Loading…
Reference in a new issue