v1.5.2 fix chrome124 and cf-https

This commit is contained in:
lanqian528 2024-10-25 22:53:26 +08:00
parent 1e2a1423b1
commit 6022f37d69
5 changed files with 6 additions and 4 deletions

View File

@ -37,7 +37,7 @@ jobs:
images: lanqian528/chat2api
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=v1.5.1
type=raw,value=v1.5.2
- name: Build and push
uses: docker/build-push-action@v5

View File

@ -28,7 +28,7 @@
## 功能
### 最新版 v1.5.1
### 最新版 v1.5.2
> 已完成
> - [x] 流式、非流式传输

View File

@ -30,7 +30,6 @@ impersonate_list = [
"chrome119",
"chrome120",
"chrome123",
"chrome124",
"edge99",
"edge101",
]

View File

@ -70,9 +70,12 @@ async def chatgpt_reverse_proxy(request: Request, path: str):
petrol = "https"
else:
petrol = "http"
if "x-forwarded-proto" in request.headers:
petrol = request.headers["x-forwarded-proto"]
params = dict(request.query_params)
request_cookies = dict(request.cookies)
headers = {
key: value for key, value in request.headers.items()
if (key.lower() not in ["host", "origin", "referer", "user-agent",

View File

@ -52,7 +52,7 @@ proxy_url_list = proxy_url.split(',') if proxy_url else []
user_agents_list = ast.literal_eval(user_agents)
logger.info("-" * 60)
logger.info("Chat2Api 1.5.1 | https://github.com/lanqian528/chat2api")
logger.info("Chat2Api 1.5.2 | https://github.com/lanqian528/chat2api")
logger.info("-" * 60)
logger.info("Environment variables:")
logger.info("API_PREFIX: " + str(api_prefix))