Moved IE workarounds to be only in the HTTP engine
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / CGI.pm
index 9f6698d..17e4eed 100644 (file)
@@ -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;