2011/2/6 <[email protected]>:
> Author: markt
> Date: Sun Feb 6 19:28:48 2011
> New Revision: 1067734
>
> URL: http://svn.apache.org/viewvc?rev=1067734&view=rev
> Log:
> First attempt at a valve to limit session creation by web crawlers.
> Docs etc to follow once it is confirmed working.
>
> Added:
>
> tomcat/trunk/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
> (with props)
>
> + uaMatcher = Pattern.compile(crawlerUserAgents).matcher("");
Wrong.
1) Pattern is threadsafe, but Matcher is not.
2) If set*() method in not called, uaMatcher is not initialized and
remains null by default.
BTW, are these bots using several user-agent headers? Maybe do not
enable the valve if there are multiple headers?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]