Adds tests for blocked server checks
This commit is contained in:
parent
194fcb8055
commit
34b790a086
2 changed files with 27 additions and 0 deletions
|
@ -68,6 +68,8 @@ def is_blocked_user_agent(request):
|
|||
""" check if a request is from a blocked server based on user agent """
|
||||
# check user agent
|
||||
user_agent = request.headers.get("User-Agent")
|
||||
if not user_agent:
|
||||
return False
|
||||
domain = re.match(regex.domain, user_agent)
|
||||
if not domain:
|
||||
# idk, we'll try again later with the actor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue