Sha256: f2c6b80434eebfb8b08474e02ab1d4d37302b086799b8e2d1e441393ef6fdabc
Contents?: true
Size: 704 Bytes
Versions: 9
Compression:
Stored size: 704 Bytes
Contents
# Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.com/terms.html require 'sqreen/rules/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
9 entries across 9 versions & 1 rubygems