Sha256: 573e95a8a18c237ad11fed49af4dd1404609e14a7bd3320a22a70ca7692a2658
Contents?: true
Size: 713 Bytes
Versions: 80
Compression:
Stored size: 713 Bytes
Contents
# Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.io/terms.html require 'sqreen/rules_callbacks/matcher_rule' require 'sqreen/frameworks' module Sqreen module Rules # FIXME: Factor with UserAgentMatchesCB # Look for crawlers class CrawlerUserAgentMatchesCB < MatcherRuleCB def pre(_inst, _args, _budget = nil, &_block) ua = framework.client_user_agent return unless ua found = match(ua) return unless found Sqreen.log.debug { "Found UA #{ua} - found: #{found}" } infos = { :found => found } record_event(infos) advise_action(nil) end end end end
Version data entries
80 entries across 80 versions & 2 rubygems