mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 05:32:41 +08:00
fix: fix removing bearer header
This commit is contained in:
@@ -9,7 +9,9 @@ const serverConfig = getServerSideConfig();
|
||||
export async function requestOpenai(req: NextRequest) {
|
||||
const controller = new AbortController();
|
||||
|
||||
const authValue = req.headers.get("Authorization") ?? "";
|
||||
const authValue =
|
||||
req.headers.get("Authorization")?.trim().replaceAll("Bearer ", "").trim() ??
|
||||
"";
|
||||
const authHeaderName = serverConfig.isAzure ? "api-key" : "Authorization";
|
||||
|
||||
let path = `${req.nextUrl.pathname}${req.nextUrl.search}`.replaceAll(
|
||||
|
Reference in New Issue
Block a user