[Bps-public-commit] HTTP-Server-Simple-Mason branch, master, updated. ab48b2a7756b6aaaea647884fc98c17f8fca0c22

Ruslan Zakirov ruz at bestpractical.com
Thu Oct 1 23:37:06 EDT 2009


The branch, master has been updated
       via  ab48b2a7756b6aaaea647884fc98c17f8fca0c22 (commit)
      from  ca9b215dfc1eb40b00d884698fa700041da55021 (commit)

Summary of changes:
 lib/HTTP/Server/Simple/Mason.pm |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit ab48b2a7756b6aaaea647884fc98c17f8fca0c22
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Oct 2 07:36:29 2009 +0400

    don't add double / in path when test for index.html

diff --git a/lib/HTTP/Server/Simple/Mason.pm b/lib/HTTP/Server/Simple/Mason.pm
index da42c55..dacc592 100644
--- a/lib/HTTP/Server/Simple/Mason.pm
+++ b/lib/HTTP/Server/Simple/Mason.pm
@@ -119,11 +119,12 @@ sub handle_request {
     local $http_header_sent = 0;
 
     my $m = $self->mason_handler;
-    if (
-        !$m->interp->comp_exists( $cgi->path_info )
-        && $m->interp->comp_exists( $cgi->path_info . "/index.html" )
-    ) {
-        $cgi->path_info( $cgi->path_info . "/index.html" );
+    unless ( $m->interp->comp_exists( $cgi->path_info ) ) {
+        my $path = $cgi->path_info;
+        $path .= '/' unless $path =~ m{/$};
+        $path .= 'index.html';
+        $cgi->path_info( $path )
+            if $m->interp->comp_exists( $path );
     }
 
     local $@;

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list