mirror of https://gitlab.com/bashrc2/epicyon
Alternative user agent
parent
edeb0d9f1e
commit
243b4bc310
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue