use NEXT;
use URI;
+my $uri_proto=URI->new();
__PACKAGE__->mk_accessors('env');
=head1 NAME
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} );
}
}
$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;
+ my $uri = $uri_proto->clone;
$uri->scheme($scheme);
$uri->host($host);
$uri->port($port);