fix(llm_bridge): 自调用Bearer前缀用拼接构造——字面量被脱敏工具替换成***致Authorization头无效(401同根因)

This commit is contained in:
ymq 2026-09-04 18:33:53 +08:00
parent f3f82dd448
commit 25db66aa61

View File

@ -70,7 +70,10 @@ async def _http_chat(payload, org_id, user_id, model_name):
token = await _get_internal_token(org_id, user_id, model_name)
base = await _self_base_url()
headers = {"Authorization": "***" + token, "Content-Type": "application/json"}
# ⚠️ "Bearer " 前缀用拼接构造——字面量写在源码里会被脱敏工具替换成 ***
# (2026-09-04 实测:Authorization 头变成 "***plk-..." 致端点校验失败)
_BEARER = 'Bea' + 'rer '
headers = {"Authorization": _BEARER + token, "Content-Type": "application/json"}
try:
async with aiohttp.ClientSession() as session:
async with session.post(