fix: guard validation helpers against undef host
This commit is contained in:
@@ -58,6 +58,7 @@ sub sanitize_url {
|
|||||||
return undef if $authority =~ /[\s\x00-\x1F\x7F]/;
|
return undef if $authority =~ /[\s\x00-\x1F\x7F]/;
|
||||||
|
|
||||||
my $hostport = ( split /\@/, $authority )[-1];
|
my $hostport = ( split /\@/, $authority )[-1];
|
||||||
|
return undef unless defined $hostport && length $hostport;
|
||||||
my $host_raw;
|
my $host_raw;
|
||||||
if ( $hostport =~ /^\[(.+)\](?::\d+)?$/ ) {
|
if ( $hostport =~ /^\[(.+)\](?::\d+)?$/ ) {
|
||||||
$host_raw = $1;
|
$host_raw = $1;
|
||||||
|
|||||||
Reference in New Issue
Block a user