mdlinkcheck: percent-encode urls before passing to curl fixup

This commit is contained in:
Viktor Szakats 2025-07-11 18:39:59 +02:00
parent 99e0893a96
commit 30303935b0
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -132,8 +132,8 @@ 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\"";
$url =~ s/\+/%2B/g;
my @content = `$curlcmd \"$url\"`;
if(!$content[0]) {
print STDERR "FAIL\n";