Plack typically uses http://0:port . For example. the following
plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root=>".");'
prints
HTTP::Server::PSGI: Accepting connections at http:
However, LWP::UserAgent (or some deeper modules) did not accept it, for example:
perl -MLWP::UserAgent -E '$u=LWP::UserAgent->new;$res=$u->get("http://0:5000/valid/path");print $res->status_line'
prints:
500 No Host option provided
but
perl -MLWP::UserAgent -E '$u=LWP::UserAgent->new;$res=$u->get("http://localhost:5000/valid/path");print $res->status_line'
prints
200 OK
Question: who is wrong?
- Is
http://0:port valid, e.g. LWP is "wrong." - or is it invalid and does the PSGI use it as a βrandom validβ label?
perl lwp psgi
kobame
source share