Skip to content

Commit 93d510d

Browse files
committed
Follow redirects, to detect more broken links
When following a incorrect or outdated link to Swift standard library on developer.apple.com, I get a 301 Moved Permanently first and then a 404 Not Found after following the redirect. Without following the redirect, curl exits with "success", causing the link to not be flagged in the report.
1 parent 8f7c1b7 commit 93d510d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/preflight

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ xpath -q -n -e '//link/@destination' |
4545
sort -u | cut -f2 -d= | grep -v '^"doc:' | sed 's/^"//; s/"$//' |
4646
while read url
4747
do
48-
if curl --silent --output /dev/null --fail --head $url
48+
if curl --silent --output /dev/null --location --fail --head $url
4949
then
5050
echo " $url"
5151
else

0 commit comments

Comments
 (0)