add return so code doesn't explode after use
[catagits/Web-Simple.git] / lib / Web / Simple / Application.pm
index 7764618..15a6d5e 100644 (file)
@@ -40,8 +40,8 @@ use warnings FATAL => 'all';
   }
 
   sub _match_against {
-     return ({}, $_[1]) unless $_[0]->{matches};
-     $_[0]->{matches}->($_[1]);
+     return ({}, $_[1]) unless $_[0]->{match};
+     $_[0]->{match}->($_[1]);
   }
 
   sub _execute_with {
@@ -100,7 +100,7 @@ sub _setup_dispatchables {
         : undef
     );
     my $new = $class->_build_dispatcher({
-      matches => $matcher,
+      match => $matcher,
       call => sub { shift;
         shift->_run_with_self($dispatch_sub, @_)
       },
@@ -160,7 +160,7 @@ sub _run_cgi {
 sub run {
   my $self = shift;
   if ($ENV{GATEWAY_INTERFACE}) {
-    $self->_run_cgi;
+    return $self->_run_cgi;
   }
   my $path = shift(@ARGV) or die "No path passed - use $0 / for root";