aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-11 15:37:21 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-12 00:14:01 -0200
commit7c62a752db77af1aec57ccd4822e87cd6fd633b6 (patch)
tree3dba130754de23d14ac428d5d597638d90d8851f
parent0db9b13b700aef4c33c750d343cf98d055dd556b (diff)
downloadrails-7c62a752db77af1aec57ccd4822e87cd6fd633b6.tar.gz
rails-7c62a752db77af1aec57ccd4822e87cd6fd633b6.tar.bz2
rails-7c62a752db77af1aec57ccd4822e87cd6fd633b6.zip
Merge pull request #8907 from rubys/master
Fix regression introduced in pull 8812
-rw-r--r--actionpack/lib/action_dispatch/middleware/static.rb3
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)