This commit is contained in:
yumoqing 2025-08-27 18:43:00 +08:00
parent cdff11dd2b
commit c36b7f9400

View File

@ -55,12 +55,12 @@ where a.userid = b.id
return rec return rec
async def bearer_auth(sor, request): async def bearer_auth(sor, request):
auth = request.headers.get('Authentication') auth = request.headers.get('Authorization')
if auth is None: if auth is None:
debug(f'headers has not "Authentication"') debug(f'headers has not "Authorization"')
return None return None
if not auth.startswith('Bearer '): if not auth.startswith('Bearer '):
debug(f'"Authentication" not starts with "Bearer "') debug(f'"Authorization" not starts with "Bearer "')
return None return None
apikey = auth[7:] apikey = auth[7:]
client_ip = request['client_ip'] client_ip = request['client_ip']
@ -75,7 +75,7 @@ async def apikey_user(sor, apikey, client_ip):
return user.id return user.id
async def deerer_auth(sor, request): async def deerer_auth(sor, request):
auth = request.headers.get('Authentication') auth = request.headers.get('Authorization')
if auth is None: if auth is None:
return None return None
if not auth.startswith('Deerer '): if not auth.startswith('Deerer '):