[Dancer-users] Bug in Dancer with HTTP_HOST

Flavio Poletti polettix at gmail.com
Tue Jan 18 20:25:26 CET 2011


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110118/3b74da65/attachment-0001.htm>


More information about the Dancer-users mailing list