Subject: | Crash when port is not specified in url |
an HTTP::Server::Brick server listening on port 80
crashes with the following:
"Can't locate object method "port" via package "http://host/ " (perhaps
you forgot to load "http://host/"?) at
/usr/lib/perl5/site_perl/5.8.8/HTTP/Server/Brick.pm line 376.
which is here:
if ($req->header('Host') =~ /^(.*):(.*)$/) {
$req->{hostname} = $1;
$req->{port} = $2;
} elsif ($req->header('Host')) {
$req->{hostname} = $req->header('Host');
Show quoted text
>> $req->{port} = $self->{daemon}->url->port;
} else {
$req->{hostname} = $self->{daemon}->url->host;
$req->{port} = $self->{daemon}->url->port;
More specifically, hitting it with http://host:80/test.html works fine;
http://host/test.html
causes the crash.