第58批防御: buildRequestUrl 已含chat/completions则绝不再补(防双重地址)
Check Source / check (push) Successful in 3s
Auto Release / build (push) Successful in 1m48s
Simple Test / test (push) Successful in 1s
Test Env / test (push) Successful in 1s

This commit is contained in:
youpaishidifu
2026-10-28 12:41:02 +08:00
parent 59bf992162
commit 2da1f2be9e
+2 -1
View File
@@ -473,7 +473,8 @@ public class AIChatManager {
String url = endpoint.baseUrl;
// 内置供应商的 baseUrl 总是基础地址,必须拼接;自定义供应商受自动补齐开关控制
boolean needAppend = !endpoint.isCustom || autoAppendCompletions;
if (needAppend) {
// ★ 防御性:即使开关为开,若 URL 已含 chat/completions 也绝不再补(避免双重地址)
if (needAppend && !url.contains("chat/completions")) {
if (!url.endsWith("/")) url += "/";
url += "chat/completions";
}