Skip to content

Commit 4ad0966

Browse files
ppisaroalders
authored andcommitted
An IPv6 zone separator must be URI-quoted
This is wrong: $ perl -Ilib -e 'use HTTP::Daemon; $d=HTTP::Daemon->new(LocalAddr=>q{fe80::250:54ff:fe00:f01%ens3}) or die; print $d->url(), qq{\n}' http://[fe80::250:54ff:fe00:f01%ens3]:50263/ The per-cent character must be quoted in an URI. This was fixed in a 81bd91d commit, but broken later in 6.10 release.
1 parent 7505cc8 commit 4ad0966

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/HTTP/Daemon.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ sub url {
4747
my $self = shift;
4848

4949
my $host = $self->sockhost;
50+
$host =~ s/%/%25/g;
5051
$host = "127.0.0.1" if $host eq "0.0.0.0";
5152
$host = "::1" if $host eq "::";
5253
$host = "[$host]" if $self->sockdomain == Socket::AF_INET6;

0 commit comments

Comments
 (0)