mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	Merge pull request #1863 from Yidadaa/bugfix-0608
feat: just disable all ngnix buffering
This commit is contained in:
		@@ -73,18 +73,18 @@ export async function requestOpenai(req: NextRequest) {
 | 
			
		||||
  try {
 | 
			
		||||
    const res = await fetch(fetchUrl, fetchOptions);
 | 
			
		||||
 | 
			
		||||
    if (res.status === 401) {
 | 
			
		||||
      // to prevent browser prompt for credentials
 | 
			
		||||
      const newHeaders = new Headers(res.headers);
 | 
			
		||||
      newHeaders.delete("www-authenticate");
 | 
			
		||||
      return new Response(res.body, {
 | 
			
		||||
        status: res.status,
 | 
			
		||||
        statusText: res.statusText,
 | 
			
		||||
        headers: newHeaders,
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
    // to prevent browser prompt for credentials
 | 
			
		||||
    const newHeaders = new Headers(res.headers);
 | 
			
		||||
    newHeaders.delete("www-authenticate");
 | 
			
		||||
 | 
			
		||||
    return res;
 | 
			
		||||
    // to disbale ngnix buffering
 | 
			
		||||
    newHeaders.set("X-Accel-Buffering", "no");
 | 
			
		||||
 | 
			
		||||
    return new Response(res.body, {
 | 
			
		||||
      status: res.status,
 | 
			
		||||
      statusText: res.statusText,
 | 
			
		||||
      headers: newHeaders,
 | 
			
		||||
    });
 | 
			
		||||
  } finally {
 | 
			
		||||
    clearTimeout(timeoutId);
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user