build: Modify curl command to include user-agent

Updated the curl command to include a user-agent string for better compatibility.
This commit is contained in:
Kroese 2026-03-23 13:54:26 +01:00 committed by GitHub
parent 6e104b2cf7
commit 07d32b34c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -30,10 +30,9 @@ jobs:
declare -A seen
check() {
local url="$1" http
http=$(curl -sSL -o /dev/null -w "%{http_code}" --max-time 10 -I -- "$url" 2>&1) || http="000"
printf '%s\n' "HTTP: $http"
http=$(curl -sSL -o /dev/null -w "%{http_code}" --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0)" --max-time 10 -I -- "$url" 2>&1) || http="000"
[[ "$http" == 2* ]] && return 0
http=$(curl -sSL -o /dev/null -w "%{http_code}" --max-time 10 -r "0-0" -- "$url" 2>&1) || http="000"
http=$(curl -sSL -o /dev/null -w "%{http_code}" --user-agent "Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0)" --max-time 10 -r "0-0" -- "$url" 2>&1) || http="000"
printf '%s\n' "HTTP: $http"
[[ "$http" == 2* ]]
}