Update common.ts

This commit is contained in:
Richard C Lim 2025-02-03 03:36:38 -05:00 committed by GitHub
parent 5d35dc9ce7
commit 07b34eb44d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,7 +14,11 @@ const isAzure = req.nextUrl.pathname.includes("azure/deployments") || Boolean(se
var authValue,
authHeaderName = "";
if (isAzure) {
authValue = `Bearer ${serverConfig.azureApiKey}`;
authValue = `Bearer ${req.headers
.get("Authorization")
?.trim()
.replaceAll("Bearer ", "")
.trim() ?? ""}`;
authHeaderName = "Authorization";
} else {
authValue = req.headers.get("Authorization") ?? "";