class RackDeflaterBypass

Wrapper for Rack::Deflater that will prevent the said Deflater from EVER touching .tgz files

Constants

BYPASS_FILES
VERSION

Public Class Methods

new(app, bypass_url_regexp = BYPASS_FILES) click to toggle source

bypass_url_regexp will be matched against PATH_INFO

# File lib/rack_deflater_bypass.rb, line 8
def initialize(app, bypass_url_regexp = BYPASS_FILES)
  @bypass_url_regexp = bypass_url_regexp
  @app = app
  @deflater = Rack::Deflater.new(@app)
end

Public Instance Methods

call(env) click to toggle source
# File lib/rack_deflater_bypass.rb, line 14
def call(env)
  if env['PATH_INFO'] =~ @bypass_url_regexp
    @app.call(env)
  else
    @deflater.call(env)
  end
end