Commit e206be33 authored by Xavier Guimard's avatar Xavier Guimard

SCRIPT_NAME is optional for handler

Avoid warning (#595)
parent ca93445c
......@@ -23,11 +23,13 @@ sub BUILD {
sub new {
my $self = Plack::Request::new(@_);
my $tmp = $self->script_name;
$self->env->{REQUEST_URI} = $self->env->{X_ORIGINAL_URI}
if ( $self->env->{X_ORIGINAL_URI} );
$self->env->{PATH_INFO} =~ s|//+|/|g;
if ( my $tmp = $self->script_name ) {
$self->env->{PATH_INFO} =~ s|^$tmp|/|;
}
$self->{uri} = uri_unescape( $self->env->{REQUEST_URI} );
$self->{uri} =~ s|//+|/|g;
$self->{datas} = {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment