fix: guard validation helpers against undef host

This commit is contained in:
2025-12-28 08:48:24 +01:00
parent 4d48f90ceb
commit 86007a74d8

View File

@@ -58,6 +58,7 @@ sub sanitize_url {
return undef if $authority =~ /[\s\x00-\x1F\x7F]/;
my $hostport = ( split /\@/, $authority )[-1];
return undef unless defined $hostport && length $hostport;
my $host_raw;
if ( $hostport =~ /^\[(.+)\](?::\d+)?$/ ) {
$host_raw = $1;