Sha256: 649d26997486efe368570bd6195cba5f9568a204e649300622e6ed91b9968e4e
Contents?: true
Size: 536 Bytes
Versions: 29
Compression:
Stored size: 536 Bytes
Contents
require 'rack/insight/logging' module Rack::Insight class PathFilter include Rack::Insight::Logging def initialize(app) @app = app end def call(env) filters = env['rack-insight.path_filters'].map do |string| %r{^#{string}} end unless filter = filters.find{|regex| regex =~ env['PATH_INFO']} return [404, {}, []] end logger.debug{ "Shortcutting collection stack: #{filter} =~ #{env['PATH_INFO']}"} if verbose(:debug) return @app.call(env) end end end
Version data entries
29 entries across 29 versions & 1 rubygems