mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 05:51:47 +08:00
fix: #1746 Can't modify immutable headers.
This commit is contained in:
@@ -50,7 +50,13 @@ export async function requestOpenai(req: NextRequest) {
|
||||
|
||||
if (res.status === 401) {
|
||||
// to prevent browser prompt for credentials
|
||||
res.headers.delete("www-authenticate");
|
||||
const newHeaders = new Headers(res.headers);
|
||||
newHeaders.delete("www-authenticate");
|
||||
return new Response(res.body, {
|
||||
status: res.status,
|
||||
statusText: res.statusText,
|
||||
headers: newHeaders,
|
||||
});
|
||||
}
|
||||
|
||||
return res;
|
||||
|
Reference in New Issue
Block a user