From c987ffa268f7f2e11ce4115296d9dc37b3a9e9c1 Mon Sep 17 00:00:00 2001 From: Mike Pastore Date: Tue, 10 Nov 2015 15:31:20 -0600 Subject: Update example use of Rack::Deflater --- lib/rack/deflater.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rack/deflater.rb b/lib/rack/deflater.rb index 62a11243..c656432e 100644 --- a/lib/rack/deflater.rb +++ b/lib/rack/deflater.rb @@ -22,7 +22,7 @@ module Rack # [app] rack app instance # [options] hash of deflater options, i.e. # 'if' - a lambda enabling / disabling deflation based on returned boolean value - # e.g use Rack::Deflater, :if => lambda { |env, status, headers, body| body.length > 512 } + # e.g use Rack::Deflater, :if => lambda { |*, body| body.map(&:bytesize).reduce(0, :+) > 512 } # 'include' - a list of content types that should be compressed def initialize(app, options = {}) @app = app -- cgit v1.2.3-24-ge0c7