Skip Menu |

This queue is for tickets about the HTTP-Server-Brick CPAN distribution.

Report information
The Basics
Id: 29042
Status: resolved
Priority: 0/
Queue: HTTP-Server-Brick

People
Owner: mark [...] aufflick.com
Requestors: mark [...] aufflick.com
david.knell [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.1.0
Fixed in: 0.1.2



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.
This is resolved in 0.1.2 (just uploaded to CPAN - give a day or two to appear on mirrors). The problem is that HTTP::Daemon->url gives URI objects when there is a port number, or a plain string if the port number is implicit (ie. 80 or 443). I didn't make a test case for this since that would require root powers to run, but I seem to have worked around it fine. I also raised this as a bug with HTTP::Daemon: #36761