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-12 00:14:01 -0200 |
commit | 7c62a752db77af1aec57ccd4822e87cd6fd633b6 (patch) | |
tree | 3dba130754de23d14ac428d5d597638d90d8851f /actionpack/lib | |
parent | 0db9b13b700aef4c33c750d343cf98d055dd556b (diff) | |
download | rails-7c62a752db77af1aec57ccd4822e87cd6fd633b6.tar.gz rails-7c62a752db77af1aec57ccd4822e87cd6fd633b6.tar.bz2 rails-7c62a752db77af1aec57ccd4822e87cd6fd633b6.zip |
Merge pull request #8907 from rubys/master
Fix regression introduced in pull 8812
Diffstat (limited to 'actionpack/lib')
-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 6e81073e1e..a8d176560c 100644 --- a/actionpack/lib/action_dispatch/middleware/static.rb +++ b/actionpack/lib/action_dispatch/middleware/static.rb @@ -5,7 +5,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) |