mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-06-02 02:40:24 +09:00
fix: remove the content-encoding header
This commit is contained in:
parent
3c92e378b5
commit
d700cbeb9a
@ -128,8 +128,8 @@ export async function requestOpenai(req: NextRequest) {
|
|||||||
|
|
||||||
// The latest version of the OpenAI API forced the content-encoding to be "br" in json response
|
// The latest version of the OpenAI API forced the content-encoding to be "br" in json response
|
||||||
// So if the streaming is disabled, we need to remove the content-encoding header
|
// So if the streaming is disabled, we need to remove the content-encoding header
|
||||||
// But vercel uses gzip to compress the response
|
// Because Vercel uses gzip to compress the response, if we don't remove the content-encoding header
|
||||||
// So we need to remove the content-encoding header
|
// The browser will try to decode the response with brotli and fail
|
||||||
newHeaders.delete("content-encoding");
|
newHeaders.delete("content-encoding");
|
||||||
|
|
||||||
return new Response(res.body, {
|
return new Response(res.body, {
|
||||||
|
Loading…
Reference in New Issue
Block a user