Static::Simple, added failing test for subrequest NEXT problem
[catagits/Catalyst-Plugin-Static-Simple.git] / lib / Catalyst / Plugin / Static / Simple.pm
index 352b442..b83215b 100644 (file)
@@ -46,7 +46,7 @@ sub prepare_action {
         return if ( $c->_locate_static_file );
     }
     
-    return $c->NEXT::prepare_action(@_);
+    return $c->NEXT::ACTUAL::prepare_action(@_);
 }
 
 # dispatch takes the file found during prepare_action and serves it
@@ -56,13 +56,13 @@ sub dispatch {
     return if ( $c->res->status != 200 );
     
     if ( $c->_static_file ) {
-       if ( $c->config->{static}->{no_logs} ) {
-          if ( $c->log->can('abort') ) { $c->log->abort(1) ; }
-       }
+        if ( $c->config->{static}->{no_logs} && $c->log->can('abort') ) {
+           $c->log->abort( 1 );
+        }
         return $c->_serve_static;
     }
     else {
-        return $c->NEXT::dispatch(@_);
+        return $c->NEXT::ACTUAL::dispatch(@_);
     }
 }
 
@@ -96,7 +96,7 @@ sub finalize {
         return $c->finalize_headers;
     }
     
-    return $c->NEXT::finalize(@_);
+    return $c->NEXT::ACTUAL::finalize(@_);
 }
 
 sub setup {
@@ -109,7 +109,9 @@ sub setup {
     $c->config->{static}->{mime_types} ||= {};
     $c->config->{static}->{use_apache} ||= 0; 
     $c->config->{static}->{debug} ||= $c->debug;
-    $c->config->{static}->{no_logs} ||= 1;
+    if ( ! defined $c->config->{static}->{no_logs} ) {
+        $c->config->{static}->{no_logs} = 1;
+    }
     
     # load up a MIME::Types object, only loading types with
     # at least 1 file extension
@@ -296,10 +298,10 @@ probably feel less "simple" to you!
 
 =head2 Aborting request logging
 
-With Catalyst 5.50, there has been added support for dropping logging for a 
-request. We've turned this on by default, as static logging tends to clutter
-the Log API, however, if you want logging of static requests, you can easily
-turn it on by setting MyApp->config->{static}->{no_logs} to 0.
+Since Catalyst 5.50, there has been added support for dropping logging for a 
+request. This is enabled by default for static files, as static requests tend
+to clutter the log output.  However, if you want logging of static requests, 
+you can enable it by setting MyApp->config->{static}->{no_logs} to 0.
 
 =head2 Forcing directories into static mode