Skip to content

Commit

Permalink
Default the SERVER_PORT to 80.
Browse files Browse the repository at this point in the history
- because mongrel2 does not seem to pass the port as part of the "host"
  in the headers when its 80 (the default HTTP port).
  • Loading branch information
Henry Baragar authored and Henry Baragar committed Apr 26, 2011
1 parent b2c4744 commit 036b7b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Plack/Handler/Mongrel2.pm
Expand Up @@ -82,6 +82,7 @@ sub mongrel2_req_to_psgi {
}
$env{SERVER_PROTOCOL} = delete $hdrs->{VERSION};
($env{SERVER_NAME}, $env{SERVER_PORT}) = split /:/, delete $hdrs->{host}, 2;
$env{SERVER_PORT} ||= 80;

foreach my $key (keys %$hdrs) {
my $new_key = uc $key;
Expand Down Expand Up @@ -389,4 +390,4 @@ This library is available under Artistic License v2, and is:
Daisuke Maki C<< <daisuke@endeworks.jp> >>
=cut
=cut

0 comments on commit 036b7b8

Please sign in to comment.