From 061ad4b51f20abc850c2ccc62a5a7e20251cf002 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 23 Jun 2025 10:34:57 +0200 Subject: [PATCH] fix: adjust headers for 429 errors --- bin/lint-markdown-links.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/lint-markdown-links.ts b/bin/lint-markdown-links.ts index c7a3a71..362789e 100644 --- a/bin/lint-markdown-links.ts +++ b/bin/lint-markdown-links.ts @@ -38,7 +38,10 @@ async function fetchExternalLink(link: string, checkRedirects = false) { const response = await fetch(link, { headers: { 'user-agent': - 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.39 Electron/29.0.0 Safari/537.36', + 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.39 Electron/29.0.0 Safari/537.36', + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', + 'accept-language': 'en-US,en;q=0.5', + 'accept-encoding': 'gzip, deflate, br', }, }); if (response.status !== 200) {