Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Aug 15, 2024
2 parents cd8bca4 + 2b0f867 commit a102bed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/api/mj/[...path]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ async function handle(
});
}

const bearToken = req.headers.get("Authorization") ?? "";
const token = bearToken.trim().replaceAll("Bearer ", "").trim();
const bearToken = req.headers.get("Authorization")?.trim() ?? "";
const token = bearToken.startsWith("Bearer ") ? bearToken.slice(7).trim() : bearToken;

const key = token ? token : serverConfig.mjpApiKey;
const key = serverConfig.mjpApiKey || token;

if (!key) {
return NextResponse.json(
Expand Down

0 comments on commit a102bed

Please sign in to comment.