no warnings 'uninitialized';
$c->req->{path} =~ s/^($loc)?\///;
my $base = URI->new;
- $base->scheme( $c->apache_request->protocol =~ /HTTPS/ ? 'https' : 'http' );
+ $base->scheme( $ENV{HTTPS} ? 'https' : 'http' );
$base->host( $c->apache_request->hostname );
$base->port( $c->apache_request->get_server_port );
- $base->path( $c->apache_request->location );
+ my $path = $c->apache_request->location;
+ $base->path( $path =~ /\/$/ ? $path : "$path/" );
$c->req->base( $base->as_string );
- $c->req->server_base( $base->scheme . '://' . $base->authority . '/' );
}
=head3 prepare_request