Skip to content

Commit

Permalink
Fix checking auth header
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrss committed Sep 23, 2023
1 parent 0cd6a79 commit e82f6db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e82f6db

Please sign in to comment.