mirror of https://gitlab.com/bashrc2/epicyon
Reject obvious bots
parent
f5930daf41
commit
b45d034332
|
@ -458,10 +458,14 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
"""
|
"""
|
||||||
agentDomain = None
|
agentDomain = None
|
||||||
if self.headers.get('User-Agent'):
|
if self.headers.get('User-Agent'):
|
||||||
agentDomain = userAgentDomain(self.headers['User-Agent'],
|
agentStr = self.headers['User-Agent']
|
||||||
self.server.debug)
|
if 'bot/' in agentStr or 'bot-' in agentStr.lower():
|
||||||
|
print('Crawler: ' + agentStr)
|
||||||
|
return True
|
||||||
|
agentDomain = userAgentDomain(agentStr, self.server.debug)
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
blockedUA = False
|
blockedUA = False
|
||||||
if not agentDomain:
|
if not agentDomain:
|
||||||
if self.server.userAgentDomainRequired:
|
if self.server.userAgentDomainRequired:
|
||||||
|
|
Loading…
Reference in New Issue