mirror of
https://github.com/lanqian528/chat2api.git
synced 2026-06-13 21:02:46 +08:00
✨ V1.6.6-beta1 支持搜索bing跳转
This commit is contained in:
parent
4d3d0f5f93
commit
fd512a1c3f
@ -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)
|
||||
|
||||
@ -1 +1 @@
|
||||
1.6.5
|
||||
1.6.6-beta1
|
||||
Loading…
Reference in New Issue
Block a user