Skip to content

Commit 2506503

Browse files
committed
chore: add timeout and decompression options to HTTP request in fetchJuejinArticle for enhanced reliability
1 parent cd50bab commit 2506503

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/engines/juejin/fetchJuejinArticle.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export async function fetchJuejinArticle(url: string): Promise<{ content: string
1818
'Sec-Fetch-Mode': 'navigate',
1919
'Sec-Fetch-Site': 'none',
2020
'Upgrade-Insecure-Requests': '1'
21-
}
21+
},
22+
timeout: 30000,
23+
decompress: true
2224
});
2325

2426
const $ = cheerio.load(response.data);

0 commit comments

Comments
 (0)