X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine%2FCGI.pm;h=17e4eed375c3c28922f15f7b517fd5230a34abc8;hb=00c9932455ecd6ca565d60d76180a2d850b7317b;hp=9f6698d52a81643719743780e8495a856be64743;hpb=0bcb98c7b698a94fe472f92509beb55f30010f18;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine/CGI.pm b/lib/Catalyst/Engine/CGI.pm index 9f6698d..17e4eed 100644 --- a/lib/Catalyst/Engine/CGI.pm +++ b/lib/Catalyst/Engine/CGI.pm @@ -94,10 +94,10 @@ sub prepare_headers { local (*ENV) = $self->env || \%ENV; # Read headers from %ENV - while ( my ( $header, $value ) = each %ENV ) { + foreach my $header ( keys %ENV ) { next unless $header =~ /^(?:HTTP|CONTENT|COOKIE)/i; ( my $field = $header ) =~ s/^HTTPS?_//; - $c->req->headers->header( $field => $value ); + $c->req->headers->header( $field => $ENV{$header} ); } } @@ -137,7 +137,7 @@ sub prepare_path { $port = $c->request->secure ? 443 : 80; } - my $path = $base_path . $ENV{PATH_INFO}; + my $path = $base_path . ( $ENV{PATH_INFO} || '' ); $path =~ s{^/+}{}; my $uri = URI->new;