From dfd6849e773f17deb60dcf2dcd18128248991e46 Mon Sep 17 00:00:00 2001 From: Anthony Shoumikhin Date: Mon, 2 Jun 2025 14:50:34 +0000 Subject: [PATCH] Update lint_urls.sh (#154838) Do not match empty urls pieces like "https://" Add headers for better handling urls like "https://www.amd.com/content/dam/amd/en/documents/instinct-tech-docs/data-sheets/amd-instinct-mi300x-data-sheet.pdf" Pull Request resolved: https://github.com/pytorch/pytorch/pull/154838 Approved by: https://github.com/Skylion007 --- scripts/lint_urls.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/lint_urls.sh b/scripts/lint_urls.sh index c8f4e183e177..0a8fddce00b3 100755 --- a/scripts/lint_urls.sh +++ b/scripts/lint_urls.sh @@ -19,7 +19,7 @@ while IFS=: read -r filepath url; do code=$(curl -k -gsLm30 --retry 3 --retry-delay 3 --retry-connrefused -o /dev/null -w "%{http_code}" -I "$url") || code=000 if [ "$code" -lt 200 ] || [ "$code" -ge 400 ]; then sleep 1 - code=$(curl -k -gsLm30 --retry 3 --retry-delay 3 --retry-connrefused -o /dev/null -w "%{http_code}" -r 0-0 -A "$user_agent" "$url") || code=000 + code=$(curl -k -gsLm30 --retry 3 --retry-delay 3 --retry-connrefused -o /dev/null -w "%{http_code}" -r 0-0 -A "$user_agent" -H "Accept-Language: en-US,en" -H "Connection: keep-alive" "$url") || code=000 fi if [ "$code" -lt 200 ] || [ "$code" -ge 400 ]; then sleep 1 @@ -62,7 +62,7 @@ while IFS=: read -r filepath url; do sleep 1 done done < <( - pattern='(?!.*@lint-ignore)(?\")]*[<>\{\}\$])[^[:space:]<>")\[\]\\|]+' + pattern='(?!.*@lint-ignore)(?\")]*[<>\{\}\$])[[:alnum:]][^[:space:]<>")\[\]\\|]*' excludes=( ':(exclude,glob)**/.*' ':(exclude,glob)**/*.lock'