Merge pull request #932 from bookwyrm-social/inbox-error

Fixes logic error in checking sender
This commit is contained in:
Mouse Reeve 2021-04-13 18:39:22 -07:00 committed by GitHub
commit 5f17b0f1e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,7 +70,10 @@ def is_blocked_user_agent(request):
user_agent = request.headers.get("User-Agent")
if not user_agent:
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.group()
return models.FederatedServer.is_blocked(url)