From e82f6db158b80800191e1092af6f8ec4bb093bfc Mon Sep 17 00:00:00 2001 From: David Stephens Date: Sat, 23 Sep 2023 17:13:32 +0100 Subject: [PATCH] Fix checking auth header --- src/router.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/router.ts b/src/router.ts index 096803e..bad1d33 100644 --- a/src/router.ts +++ b/src/router.ts @@ -13,8 +13,8 @@ function makeScoreKey(coFounder: string | undefined) { } function checkAuthentication(request: ScoreRequest, env: Env) { - const authHeader = request.headers.get("Authorization"); - if (!authHeader || authHeader.startsWith("Bearer ")) { + const authHeader = request.headers.get("authorization"); + if (!authHeader || !authHeader.startsWith("Bearer ")) { throw new StatusError(401); } const token = authHeader.substring(7, authHeader.length);