fixed base for apache
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / Apache.pm
index 97b3387..94dacf1 100644 (file)
@@ -140,7 +140,8 @@ sub prepare_path {
     $base->scheme( $c->apache_request->protocol =~ /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 );
 }
 
@@ -162,11 +163,10 @@ sub prepare_uploads {
     my $c = shift;
     for my $upload ( $c->apache_request->upload ) {
         $upload = $c->apache_request->upload($upload) if MP2;
-        $c->req->uploads->{ $upload->name } = {
-            fh       => $upload->fh,
-            filename => $upload->filename,
-            size     => $upload->size,
-            type     => $upload->type
+        $c->req->uploads->{ $upload->filename } = {
+            fh   => $upload->fh,
+            size => $upload->size,
+            type => $upload->type
         };
     }
 }