V1.6.6-beta1 支持搜索bing跳转

This commit is contained in:
0xShawnLai 2024-11-01 11:27:20 +08:00
parent 4d3d0f5f93
commit fd512a1c3f
2 changed files with 6 additions and 2 deletions

View File

@ -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)

View File

@ -1 +1 @@
1.6.5
1.6.6-beta1