Show user-agent domain

main
Bob Mottram 2021-06-20 15:45:39 +01:00
parent 4decc56a37
commit 1b125711e5
1 changed files with 3 additions and 0 deletions

View File

@ -465,12 +465,15 @@ class PubServer(BaseHTTPRequestHandler):
agentDomain = agentDomain.split('://')[1]
if '/' in agentDomain:
agentDomain = agentDomain.split('/')[0]
if ')' in agentDomain:
agentDomain = agentDomain.split('/')[0].strip()
if ' ' in agentDomain:
agentDomain = agentDomain.replace(' ', '')
if ';' in agentDomain:
agentDomain = agentDomain.replace(';', '')
if '.' not in agentDomain:
return None
print('User-Agent Domain: ' + agentDomain)
return agentDomain
def _blockedUserAgent(self, callingDomain: str) -> bool: