mdlinkcheck: percent-encode urls before passing to curl

Fixing:
```
check https://codepoints.net/U+00DF
FAIL
docs/URL-SYNTAX.md:199 ERROR links to missing URL https://codepoints.net/U+00DF
```
This commit is contained in:
Viktor Szakats 2025-07-11 18:35:19 +02:00
parent 28c6272fa0
commit 99e0893a96
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -132,6 +132,7 @@ sub checkurl {
}
print "check $url\n";
$url =~ s/([^A-Za-z0-9_.~-])/sprintf("%%%02X", ord($1))/ge;
my $curlcmd="curl -ILfsm10 --retry 2 --retry-delay 5 -A \"Mozilla/curl.se link-probe\"";
my @content = `$curlcmd \"$url\"`;
if(!$content[0]) {