fixed isa tree
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / Apache.pm
index ebc3aa1..fc69b1c 100644 (file)
@@ -137,12 +137,12 @@ sub prepare_path {
     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