fix: 修复buildFetchHeaders参数类型错误,useMobile→UA#索引

This commit is contained in:
thzxx
2026-06-12 14:47:13 +08:00
parent a1f06a4c27
commit 5cf961df84
+2 -2
View File
@@ -426,7 +426,7 @@ export async function handleWebFetch(params: { url: string; max_chars?: number;
truncated,
length: text.length,
retries: attempt,
method: useMobile ? 'fetch(mobile)' : 'fetch(desktop)',
method: `fetch (UA#${attempt % UA_POOL.length})`,
};
} catch (err) {
const errMsg = (err as Error).message;
@@ -514,7 +514,7 @@ async function handleWebSearchSearxng(
sendLog('info', `🔍 SearXNG 搜索`, `${query}${url} (${format})`);
try {
const headers = buildFetchHeaders(apiUrl, false);
const headers = buildFetchHeaders(apiUrl, 0);
if (authKey) headers['Authorization'] = `Bearer ${authKey}`;
const resp = await fetchWithTimeout(apiUrl, HTTP_TIMEOUT, headers);
if (!resp || !resp.ok) {