From ba94a01062380b9f122c26fbd0612cebf91f5915 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 22 Oct 2024 10:09:53 +0200 Subject: [PATCH] remove quotas in string of token fixed more --- api/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/views.py b/api/views.py index 7ea8a76..d262da4 100644 --- a/api/views.py +++ b/api/views.py @@ -32,8 +32,9 @@ def NewSnapshot(request): auth_header = request.headers.get('Authorization') if not auth_header or not auth_header.startswith('Bearer '): return JsonResponse({'error': 'Invalid or missing token'}, status=401) + + token = auth_header.split(' ')[1].strip("'").strip('"') - token = auth_header.split(' ')[1].strip("'") tk = Token.objects.filter(token=token).first() if not tk: return JsonResponse({'error': 'Invalid or missing token'}, status=401)