User-Agent domain detection

main
Bob Mottram 2021-06-20 15:51:03 +01:00
parent 1b125711e5
commit 072b690f31
1 changed files with 3 additions and 3 deletions

View File

@ -458,15 +458,15 @@ class PubServer(BaseHTTPRequestHandler):
if not self.headers.get('User-Agent'):
return None
agentStr = self.headers.get('User-Agent')
if '+' not in agentStr:
if '+http' not in agentStr:
return None
agentDomain = agentStr.split('+')[1].strip()
agentDomain = agentStr.split('+http')[1].strip()
if '://' in agentDomain:
agentDomain = agentDomain.split('://')[1]
if '/' in agentDomain:
agentDomain = agentDomain.split('/')[0]
if ')' in agentDomain:
agentDomain = agentDomain.split('/')[0].strip()
agentDomain = agentDomain.split(')')[0].strip()
if ' ' in agentDomain:
agentDomain = agentDomain.replace(' ', '')
if ';' in agentDomain: