From 243b4bc310ea3f9c893f76e0475c2c91513866cc Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 2 Sep 2021 10:07:49 +0100 Subject: [PATCH] Alternative user agent --- daemon.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/daemon.py b/daemon.py index 8b33a6637..c141559ca 100644 --- a/daemon.py +++ b/daemon.py @@ -497,8 +497,13 @@ class PubServer(BaseHTTPRequestHandler): """ agentDomain = None agentStr = None + if self.headers.get('User-Agent'): agentStr = self.headers['User-Agent'] + elif self.headers.get('user-agent'): + agentStr = self.headers['user-agent'] + + if agentStr: # is this a web crawler? If so the block it agentStrLower = agentStr.lower() if 'bot/' in agentStrLower or 'bot-' in agentStrLower: