forked from mirrors/bookwyrm
Merge pull request #932 from bookwyrm-social/inbox-error
Fixes logic error in checking sender
This commit is contained in:
commit
5f17b0f1e4
1 changed files with 4 additions and 1 deletions
|
@ -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.group()
|
||||||
return models.FederatedServer.is_blocked(url)
|
return models.FederatedServer.is_blocked(url)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue