Permalink
Browse files

Deprecated Rack::File cache_control option for 1.5

  • Loading branch information...
1 parent 63b5adf commit 1824547e8dfa8c2b553a913a6ad0935dd6ff7d12 @raggi raggi committed Nov 3, 2012
Showing with 1 addition and 16 deletions.
  1. +1 −8 lib/rack/file.rb
  2. +0 −8 test/spec_file.rb
View
@@ -23,14 +23,7 @@ class File
def initialize(root, headers={})
@root = root
- # Allow a cache_control string for backwards compatibility
- if headers.instance_of? String
- warn \
- "Rack::File headers parameter replaces cache_control after Rack 1.5."
- @headers = { 'Cache-Control' => headers }
- else
- @headers = headers
- end
+ @headers = headers
end
def call(env)
View
@@ -145,14 +145,6 @@ def file(*args)
res["Content-Range"].should.equal "bytes */193"
end
- should "support legacy cache control options provided as string" do
- env = Rack::MockRequest.env_for("/cgi/test")
- status, heads, _ = file(DOCROOT, 'public, max-age=38').call(env)
-
- status.should.equal 200
- heads['Cache-Control'].should.equal 'public, max-age=38'
- end
-
should "support custom http headers" do
env = Rack::MockRequest.env_for("/cgi/test")
status, heads, _ = file(DOCROOT, 'Cache-Control' => 'public, max-age=38',

0 comments on commit 1824547

Please sign in to comment.