Check that user agent exists

merge-requests/30/head
Bob Mottram 2021-10-24 12:48:16 +01:00
parent b54cc5b006
commit b6479903cf
1 changed files with 3 additions and 0 deletions

View File

@ -538,6 +538,9 @@ class PubServer(BaseHTTPRequestHandler):
def _blockedUserAgent(self, callingDomain: str, agentStr: str) -> bool:
"""Should a GET or POST be blocked based upon its user agent?
"""
if not agentStr:
return False
agentStrLower = agentStr.lower()
defaultAgentBlocks = [
'fedilist.com'