changeset 5534:6698d5db825a

fix spider / user agent detection
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 13 Feb 2010 21:13:00 +0100
parents 54e0fc07a9d4
children ac5dc19e0a0e
files MoinMoin/web/contexts.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/web/contexts.py	Sat Feb 13 19:06:54 2010 +0100
+++ b/MoinMoin/web/contexts.py	Sat Feb 13 21:13:00 2010 +0100
@@ -144,9 +144,9 @@
     def isSpiderAgent(self):
         """ Simple check if useragent is a spider bot. """
         cfg = self.cfg
-        user_agent = self.request.user_agent
+        user_agent = self.environ.get('HTTP_USER_AGENT')
         if user_agent and cfg.cache.ua_spiders:
-            return cfg.cache.ua_spiders.search(user_agent.browser) is not None
+            return cfg.cache.ua_spiders.search(user_agent) is not None
         return False
     isSpiderAgent = EnvironProxy(isSpiderAgent)