[Dancer-users] Bug in Dancer with HTTP_HOST

Peter Gordon peter at pg-consultants.com
Tue Jan 18 22:31:43 CET 2011


The problem is that the next address is 
http://localhost, 127.0.0.1:3000/blah

That is, the whole thing is concatenated into the url, making it a bad
url.

Peter


On Tue, 2011-01-18 at 20:25 +0100, Flavio Poletti wrote:
> Ehr... assuming that the layman does not grab why it is clearly
> incorrect would you please elaborate? Is it because the next URI has
> the IP address instead of "localhost", like http://127.0.0.1:3000/blah
> instead of http://localhost:3000/blah?
>  
> Cheers,
>  
>    Flavio.
> 
> 
> On Tue, Jan 18, 2011 at 6:48 PM, Peter Gordon
> <peter at pg-consultants.com> wrote:
>         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
>         
>         _______________________________________________
>         Dancer-users mailing list
>         Dancer-users at perldancer.org
>         http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
> 




More information about the Dancer-users mailing list