from override to around, because that actually works
[catagits/Catalyst-Plugin-Static-Simple.git] / lib / Catalyst / Plugin / Static / Simple.pm
index 4f1a1c9..05e4c8a 100644 (file)
@@ -5,12 +5,13 @@ use File::stat;
 use File::Spec ();
 use IO::File ();
 use MIME::Types ();
+use MooseX::Types::Moose qw/ArrayRef Str/;
 use namespace::autoclean;
 
-our $VERSION = '0.26';
+our $VERSION = '0.28';
 
 has _static_file => ( is => 'rw' );
-has _static_debug_message => ( is => 'rw', isa => 'Str' );
+has _static_debug_message => ( is => 'rw', isa => ArrayRef[Str] );
 
 before prepare_action => sub {
     my $c = shift;
@@ -59,7 +60,8 @@ before prepare_action => sub {
     }
 };
 
-override dispatch => sub {
+around dispatch => sub {
+    my $orig = shift;
     my $c = shift;
 
     return if ( $c->res->status != 200 );
@@ -71,7 +73,7 @@ override dispatch => sub {
         return $c->_serve_static;
     }
     else {
-        return super;
+        return $c->$orig(@_);
     }
 };
 
@@ -568,6 +570,8 @@ Tomas Doran, <bobtfish@bobtfish.net>
 
 Justin Wheeler (dnm)
 
+Matt S Trout, <mst@shadowcat.co.uk>
+
 =head1 THANKS
 
 The authors of Catalyst::Plugin::Static: