mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-09-30 23:26:39 +08:00
fixup
This commit is contained in:
parent
5b531a66df
commit
344f7bac5c
@ -31,6 +31,7 @@ export function middleware(req: NextRequest) {
|
||||
// inject api key
|
||||
if (!token) {
|
||||
const apiKey = process.env.OPENAI_API_KEY;
|
||||
console.log("apiKey", apiKey);
|
||||
if (apiKey) {
|
||||
req.headers.set("token", apiKey);
|
||||
} else {
|
||||
@ -46,5 +47,9 @@ export function middleware(req: NextRequest) {
|
||||
}
|
||||
}
|
||||
|
||||
return NextResponse.next();
|
||||
return NextResponse.next({
|
||||
request: {
|
||||
headers: req.headers,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user