[Dancer-users] Bug in Dancer with HTTP_HOST

Peter Gordon peter at pg-consultants.com
Tue Jan 18 18:48:26 CET 2011


I am trying to use dancer in standalone mode and testing it locally.
I am using Ubuntu with Dancer 1.3000_02

In the screen dump I am seeing the HTTP_HOST variable set as:

HTTP_HOST  => 'localhost, 127.0.0.1:3000',

It is used in Dancer/Request.pm and is used to build the next url, which
clearly is incorrect.

sub base {
    my $self = shift;

    my @env_names = qw(
      SERVER_NAME HTTP_HOST SERVER_PORT SCRIPT_NAME psgi.url_scheme
    );

    my ($server, $host, $port, $path, $scheme) =
@{$self->{env}}{@env_names};
    $host =~ s!.*,\s+!! ; #pmg 
    $scheme ||= $self->{'env'}{'PSGI.URL_SCHEME'};    # Windows

Peter



More information about the Dancer-users mailing list