Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Deprecated Rack::File cache_control option for 1.5

  • Loading branch information...
commit 1824547e8dfa8c2b553a913a6ad0935dd6ff7d12 1 parent 63b5adf
@raggi raggi authored
Showing with 1 addition and 16 deletions.
  1. +1 −8 lib/rack/file.rb
  2. +0 −8 test/spec_file.rb
View
9 lib/rack/file.rb
@@ -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

Shouldn't this stay in until the 2.0 release, according to semantic versioning?

The deprecation warning wasn't part of 1.4.1, so this will be a surprise when people upgrade to 1.5.

@raggi Owner
raggi added a note

If we were following semantic versioning, you would be correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
end
def call(env)
View
8 test/spec_file.rb
@@ -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',
Please sign in to comment.
Something went wrong with that request. Please try again.