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