diff options
Diffstat (limited to 'lib/rack/deflater.rb')
-rw-r--r-- | lib/rack/deflater.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rack/deflater.rb b/lib/rack/deflater.rb index 62a11243..f0fa5e4f 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 { |env, status, headers, body| body.map(&:bytesize).reduce(0, :+) > 512 } # 'include' - a list of content types that should be compressed def initialize(app, options = {}) @app = app |