Fixes logic error in checking sender

This commit is contained in:
Mouse Reeve 2021-04-13 18:04:54 -07:00
parent 8ec93398ce
commit e8d1c04712

View file

@ -70,7 +70,10 @@ def is_blocked_user_agent(request):
user_agent = request.headers.get("User-Agent") user_agent = request.headers.get("User-Agent")
if not user_agent: if not user_agent:
return False return False
url = re.search(r"https?://{:s}/?".format(regex.domain), user_agent).group() url = re.search(r"https?://{:s}/?".format(regex.domain), user_agent)
if not url:
return False
url = url.groups()
return models.FederatedServer.is_blocked(url) return models.FederatedServer.is_blocked(url)