From 5cf961df8467736abc6c04d3b27ff84d5238aee3 Mon Sep 17 00:00:00 2001 From: thzxx Date: Fri, 12 Jun 2026 14:47:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DbuildFetchHeaders?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?useMobile=E2=86=92UA#=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/tool-handlers-system.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/tool-handlers-system.ts b/src/main/tool-handlers-system.ts index 4cfb538..e01b07d 100644 --- a/src/main/tool-handlers-system.ts +++ b/src/main/tool-handlers-system.ts @@ -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) {