Incorrect URL protocol in server_ready message when using HTTP::Server::PSGI with SSL #306

siracusa opened this Issue Jul 5, 2012 · 1 comment

2 participants


When using the (still undocumented?) SSL support in HTTP::Server::PSGI, the server_ready message emitted by the code reference set in Plack::Runner's prepare_devel() method shows an http:// URL instead of an https:// URL. Example message:

HTTP::Server::PSGI: Accepting connections at http://localhost:5501/

The correct URL is https://localhost:5501/

The problematic line in Plack::Runner is 206:

my $proto = $args->{proto} || 'http';

$args seems to be an HTTP::Server::PSGI object in this case, so it's kind of unseemly to be rummaging around inside it to look at $args->{proto}. Anyway, it's not set, but $args->{ssl} is set. I'd submit a patch, but looking at $args->{ssl} doesn't seem much better than what it's currently doing. I don't know enough about the internals to know the "right" way to do this so that it works with all servers and not just HTTP::Server::PSGI. But the incorrect message is frustrating me and my coworkers right now since it's nice to be able to copy/paste the URL of a server right from its start message in development.

@miyagawa miyagawa closed this in 5e361d3 Jul 5, 2012
plack member

I patched it to pass the right proto value to the callback. Hope it's fixed with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment