diff options
author | Sam Ruby <rubys@intertwingly.net> | 2013-01-11 16:48:58 -0500 |
---|---|---|
committer | Sam Ruby <rubys@intertwingly.net> | 2013-01-11 16:48:58 -0500 |
commit | c692774bbae528d83925d04e1c3cebb73e3f8ae5 (patch) | |
tree | 3a0a022997a08e238557ee212e0c32c2e14094d7 /actionpack | |
parent | 7738222173e547ed92c6f85a64ececb766825cf3 (diff) | |
download | rails-c692774bbae528d83925d04e1c3cebb73e3f8ae5.tar.gz rails-c692774bbae528d83925d04e1c3cebb73e3f8ae5.tar.bz2 rails-c692774bbae528d83925d04e1c3cebb73e3f8ae5.zip |
Fix regression introduced in pull request 8812
See https://github.com/rails/rails/pull/8812#commitcomment-2416514
Diffstat (limited to 'actionpack')
-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) |