airsltd commited on
Commit
bee22e6
·
1 Parent(s): 61760bc
Files changed (1) hide show
  1. proxyserver-fastapi.py +1 -1
proxyserver-fastapi.py CHANGED
@@ -81,7 +81,7 @@ async def proxy_request(url_path: str, request: Request):
81
 
82
  # 转发原始请求的头部,排除 'Host' 头部以避免冲突
83
  # FastAPI 的 request.headers 是不可变的,需要转换为字典
84
- headers = {key: value for key, value in request.headers.items() if key.lower() != 'host'}
85
  # headers["user-agent"] = "PostmanRuntime/7.45.0"
86
 
87
  # 将检索到的第三方API密钥添加到目标API的请求头中
 
81
 
82
  # 转发原始请求的头部,排除 'Host' 头部以避免冲突
83
  # FastAPI 的 request.headers 是不可变的,需要转换为字典
84
+ headers = {key: value for key, value in request.headers.items() if key.lower() != 'host' and key.lower() != 'content-length'}
85
  # headers["user-agent"] = "PostmanRuntime/7.45.0"
86
 
87
  # 将检索到的第三方API密钥添加到目标API的请求头中