Outbox sensitive to user agent strings

This commit is contained in:
Mouse Reeve
2021-02-23 11:34:15 -08:00
parent 27d81306e3
commit 6e09d485c4
6 changed files with 53 additions and 11 deletions

View File

@ -24,8 +24,8 @@ def is_api_request(request):
request.path[-5:] == '.json'
def is_bookworm_request(request):
''' check if the request is coming from another bookworm instance '''
def is_bookwyrm_request(request):
''' check if the request is coming from another bookwyrm instance '''
user_agent = request.headers.get('User-Agent')
if user_agent is None or \
re.search(regex.bookwyrm_user_agent, user_agent) is None: