diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-11 15:37:21 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-11 15:37:21 -0800 |
commit | c1d722558ee2bd373ca4768c48b8ae944e1bdb05 (patch) | |
tree | 3a0a022997a08e238557ee212e0c32c2e14094d7 /actionpack/lib/action_dispatch/middleware/static.rb | |
parent | 7738222173e547ed92c6f85a64ececb766825cf3 (diff) | |
parent | c692774bbae528d83925d04e1c3cebb73e3f8ae5 (diff) | |
download | rails-c1d722558ee2bd373ca4768c48b8ae944e1bdb05.tar.gz rails-c1d722558ee2bd373ca4768c48b8ae944e1bdb05.tar.bz2 rails-c1d722558ee2bd373ca4768c48b8ae944e1bdb05.zip |
Merge pull request #8907 from rubys/master
Fix regression introduced in pull 8812
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/static.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/static.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/static.rb b/actionpack/lib/action_dispatch/middleware/static.rb index 1c9512ad01..c6a7d9c415 100644 --- a/actionpack/lib/action_dispatch/middleware/static.rb +++ b/actionpack/lib/action_dispatch/middleware/static.rb @@ -6,7 +6,8 @@ module ActionDispatch def initialize(root, cache_control) @root = root.chomp('/') @compiled_root = /^#{Regexp.escape(root)}/ - @file_server = ::Rack::File.new(@root, 'Cache-Control' => cache_control) + headers = cache_control && { 'Cache-Control' => cache_control } + @file_server = ::Rack::File.new(@root, headers) end def match?(path) |