From 90bb1247ccbac2469771d019b26f7664cefb4a32 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 30 May 2022 09:07:39 -0700 Subject: [PATCH] Configure link check to use `Accept-Encoding` header for docs.github.com links The link check job of the "Check Markdown" workflow has had frequent intermittent spurious failures recently, caused by links under the docs.github.com domain returning 403 HTTP status. Others experiencing the same problem reported that they were able to work around the problem by providing a custom `Accept-Encoding` HTTP request header. Although I was not able to find any explanation of why, it does appear to resolve the problem. Since the problem seems to be permanent and the only other workarounds I have identified are unappealing (considering links returning 403 statuses alive, or ignoring all docs.github.com links), I think it is worth a try. --- .github/.markdown-link-check.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/.markdown-link-check.json b/.github/.markdown-link-check.json index da798797..c5e178dd 100644 --- a/.github/.markdown-link-check.json +++ b/.github/.markdown-link-check.json @@ -1,4 +1,12 @@ { + "httpHeaders": [ + { + "urls": ["https://docs.github.com/"], + "headers": { + "Accept-Encoding": "gzip, deflate, br" + } + } + ], "retryOn429": true, "retryCount": 3, "aliveStatusCodes": [200, 206]