From 5da7383e2543fd12a39ef4292f6330ee25cb47ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C4=83t=C4=83lin=20Mari=C8=99?= Date: Fri, 1 Jul 2022 12:43:40 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Send=20"Accept-Encoding"=20HTTP=20h?= =?UTF-8?q?eader=20when=20checking=20"help.github.com"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the "Accept-Encoding" HTTP header GitHub blocks the requests made to "help.github.com". - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - See also: https://github.com/github/docs/issues/17358 --- tests/check_links_from_markdown_files.sh | 6 +++++- tests/markdown-link-check.json | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/markdown-link-check.json diff --git a/tests/check_links_from_markdown_files.sh b/tests/check_links_from_markdown_files.sh index 541b41c3c..cf34c8e7a 100755 --- a/tests/check_links_from_markdown_files.sh +++ b/tests/check_links_from_markdown_files.sh @@ -6,7 +6,11 @@ cd "$(dirname "${BASH_SOURCE[0]}")" \ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - check_links() { - npx markdown-link-check@^3 --quiet --retry "$file" + npx markdown-link-check@^3 \ + --config markdown-link-check.json \ + --quiet \ + --retry \ + "$file" } check_markdown_files check_links diff --git a/tests/markdown-link-check.json b/tests/markdown-link-check.json new file mode 100644 index 000000000..7a93f9077 --- /dev/null +++ b/tests/markdown-link-check.json @@ -0,0 +1,10 @@ +{ + "httpHeaders": [ + { + "urls": ["https://help.github.com"], + "headers": { + "Accept-Encoding": "br, gzip, deflate" + } + } + ] +}