Permalink
Browse files

Added missing 4th parameter in :skip_if option.

  • Loading branch information...
1 parent 3660128 commit ea2abf2bc8ba4dc1bec6694514528a2e5fc3ab0c @jakubpawlowicz committed Nov 14, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/rack/deflater.rb
  2. +2 −2 test/spec_deflater.rb
View
@@ -123,7 +123,7 @@ def should_deflate?(env, status, headers, body)
end
# Skip if :skip_if lambda is provided and it evaluates to true
- if @options[:skip_if] && @options[:skip_if].call(status, headers, body)
+ if @options[:skip_if] && @options[:skip_if].call(env, status, headers, body)
return false
end
View
@@ -262,7 +262,7 @@ class << body; def each; yield("foo"); yield("bar"); end; end
app = lambda do |env|
[200, {'Content-Type' => 'text/plain', 'Content-Encoding' => 'identity' }, [body]]
end
- skip_if = lambda do |status, header, body|
+ skip_if = lambda do |env, status, header, body|
true
end
request = Rack::MockRequest.env_for("", "HTTP_ACCEPT_ENCODING" => "gzip")
@@ -277,7 +277,7 @@ class << body; def each; yield("foo"); yield("bar"); end; end
app = lambda do |env|
[200, {'Content-Type' => 'text/plain', 'Content-Encoding' => 'identity' }, [body]]
end
- skip_if = lambda do |status, header, body|
+ skip_if = lambda do |env, status, header, body|
false
end
request = Rack::MockRequest.env_for("", "HTTP_ACCEPT_ENCODING" => "deflate")

0 comments on commit ea2abf2

Please sign in to comment.