mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-09-27 21:56:38 +08:00
Update common.ts
debug logger
This commit is contained in:
parent
97b6eaa38a
commit
a4db5a9011
@ -26,7 +26,21 @@ const isAzure = req.nextUrl.pathname.includes("azure/deployments") || Boolean(se
|
||||
authValue = req.headers.get("Authorization") ?? "";
|
||||
authHeaderName = "Authorization";
|
||||
}
|
||||
|
||||
// Add debug logs
|
||||
console.log("[Auth Header Name]", authHeaderName);
|
||||
console.log("[Auth Value Present]", !!authValue);
|
||||
|
||||
const fetchOptions: RequestInit = {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"Cache-Control": "no-store",
|
||||
[authHeaderName]: authValue, // Make sure this is being set
|
||||
...(serverConfig.openaiOrgId && {
|
||||
"OpenAI-Organization": serverConfig.openaiOrgId,
|
||||
}),
|
||||
},
|
||||
|
||||
let path = `${req.nextUrl.pathname}`.replaceAll("/api/openai/", "");
|
||||
let baseUrl =
|
||||
(isAzure ? serverConfig.azureUrl : serverConfig.baseUrl) || OPENAI_BASE_URL;
|
||||
@ -198,3 +212,4 @@ const isAzure = req.nextUrl.pathname.includes("azure/deployments") || Boolean(se
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
}
|
||||
console.log("[Request Headers]", fetchOptions.headers);
|
||||
|
Loading…
Reference in New Issue
Block a user