fix(astrbot): let one rejected attachment path fall through to the next
The candidate search returned on the first 401, so only the first of the three addresses was ever tried — the log shows ten requests to /api/chat/get_file and not a single download record. A rejection is per-endpoint here rather than per-connection. /api/chat/* is the dashboard's own API and wants a dashboard JWT, while /api/v1/* accepts the API key the connection already holds, so a 401 from one says nothing about the others. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
这个提交存在于:
父节点
7a6877d7cc
当前提交
4063215b0a
共有 1 个文件被更改,包括 5 次插入 和 3 次删除
|
|
@ -525,9 +525,11 @@ impl AstrBotClient {
|
|||
status = status.as_u16(),
|
||||
"astrbot attachment request"
|
||||
);
|
||||
if status.as_u16() == 401 || status.as_u16() == 403 {
|
||||
return Err(AstrBotClientError::HttpStatus(status));
|
||||
}
|
||||
// A rejection is per-endpoint, not per-connection: `/api/chat/*` is the
|
||||
// dashboard's own API and wants a dashboard JWT, while `/api/v1/*`
|
||||
// accepts the API key the connection already holds. Aborting the whole
|
||||
// search on the first 401 meant the remaining candidates were never
|
||||
// tried at all.
|
||||
if !status.is_success() {
|
||||
return Ok(Err(format!("HTTP {}", status.as_u16())));
|
||||
}
|
||||
|
|
|
|||
正在加载…
添加表格
在新工单中引用