Skip to content

Commit 4d01a81

Browse files
authored
build: Use Firefox impersonation while checking links (#1681)
1 parent d8e51d8 commit 4d01a81

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/links.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ jobs:
2828
count=0
2929
host=""
3030
declare -A seen
31+
wget https://github.com/lwthiker/curl-impersonate/releases/download/v0.6.1/curl-impersonate-v0.6.1.x86_64-linux-gnu.tar.gz
32+
tar -xzf curl-impersonate-v0.6.1.x86_64-linux-gnu.tar.gz
33+
sudo cp curl-impersonate-ff /usr/local/bin/
3134
check() {
3235
local url="$1" http
33-
http=$(curl -sSL -o /dev/null -w "%{http_code}" --max-time 10 -I -- "$url" 2>&1) || http="000"
36+
http=$(curl-impersonate-ff -sSL -o /dev/null -w "%{http_code}" --max-time 10 -I -- "$url" 2>&1) || http="000"
3437
[[ "$http" == 2* ]] && return 0
35-
http=$(curl -sSL -o /dev/null -w "%{http_code}" --max-time 10 -r "0-0" -- "$url" 2>&1) || http="000"
38+
http=$(curl-impersonate-ff -sSL -o /dev/null -w "%{http_code}" --max-time 10 -r "0-0" -- "$url" 2>&1) || http="000"
3639
[[ "$http" == 2* ]]
3740
}
3841
while IFS= read -r line; do

0 commit comments

Comments
 (0)