Merge pull request #2355 from fyl080801/main

fix: cloudflare headers
This commit is contained in:
Yifei Zhang 2023-07-11 23:57:03 +08:00 committed by GitHub
commit 22cf78d506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,12 +35,12 @@ export async function requestOpenai(req: NextRequest) {
const fetchOptions: RequestInit = { const fetchOptions: RequestInit = {
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
"Cache-Control": "no-store",
Authorization: authValue, Authorization: authValue,
...(process.env.OPENAI_ORG_ID && { ...(process.env.OPENAI_ORG_ID && {
"OpenAI-Organization": process.env.OPENAI_ORG_ID, "OpenAI-Organization": process.env.OPENAI_ORG_ID,
}), }),
}, },
cache: "no-store",
method: req.method, method: req.method,
body: req.body, body: req.body,
// @ts-ignore // @ts-ignore