feat: add User-Agent header to fetch request in handleWebsiteIcon function

This commit is contained in:
shuaiplus
2026-03-16 22:08:08 +08:00
+1
View File
@@ -87,6 +87,7 @@ async function handleWebsiteIcon(host: string): Promise<Response> {
const upstream = `https://favicon.im/${encodeURIComponent(normalizedHost)}`; const upstream = `https://favicon.im/${encodeURIComponent(normalizedHost)}`;
try { try {
const resp = await fetch(upstream, { const resp = await fetch(upstream, {
headers: { 'User-Agent': 'NodeWarden/1.0' },
redirect: 'follow', redirect: 'follow',
cf: { cf: {
cacheEverything: true, cacheEverything: true,