From fd512a1c3f0c4aba62fbcd8f0028ae097a88be76 Mon Sep 17 00:00:00 2001 From: 0xShawnLai Date: Fri, 1 Nov 2024 11:27:20 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20V1.6.6-beta1=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=90=9C=E7=B4=A2bing=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gateway/reverseProxy.py | 6 +++++- version.txt | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gateway/reverseProxy.py b/gateway/reverseProxy.py index 962482d..259ba88 100644 --- a/gateway/reverseProxy.py +++ b/gateway/reverseProxy.py @@ -163,7 +163,11 @@ async def chatgpt_reverse_proxy(request: Request, path: str): background = BackgroundTask(client.close) r = await client.request(request.method, f"{base_url}/{path}", params=params, headers=headers, cookies=request_cookies, data=data, stream=True, allow_redirects=False) - + if r.status_code == 307: + if "bing" in path: + return Response(status_code=307, + headers={"Location": r.headers.get("Location").replace("chatgpt.com", origin_host) + .replace("https", petrol)}, background=background) if r.status_code == 302: return Response(status_code=302, headers={"Location": r.headers.get("Location").replace("chatgpt.com", origin_host) diff --git a/version.txt b/version.txt index 49ebdd6..e0ed9d7 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.6.5 \ No newline at end of file +1.6.6-beta1 \ No newline at end of file