X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FSerialize%2FView.pm;h=6f900032f277d680911e16f128051a837778ca69;hb=0e1381b4a58f89c8764463ee71f089f4c65ca081;hp=286fc889ca3d8eb723f9b1facb8450c5d87419e7;hpb=067d48ee88e1337e1bfc35b56188fbb438377155;p=catagits%2FCatalyst-Action-REST.git diff --git a/lib/Catalyst/Action/Serialize/View.pm b/lib/Catalyst/Action/Serialize/View.pm index 286fc88..6f90003 100644 --- a/lib/Catalyst/Action/Serialize/View.pm +++ b/lib/Catalyst/Action/Serialize/View.pm @@ -4,10 +4,17 @@ use namespace::autoclean; extends 'Catalyst::Action'; +our $VERSION = '0.96'; +$VERSION = eval $VERSION; + sub execute { my $self = shift; my ( $controller, $c, $view ) = @_; + # Views don't care / are not going to render an entity for 3XX + # responses. + return 1 if $c->response->status =~ /^(?:204|3\d\d)$/; + my $stash_key = ( $controller->{'serialize'} ? $controller->{'serialize'}->{'stash_key'} : @@ -30,4 +37,6 @@ sub execute { } } +__PACKAGE__->meta->make_immutable; + 1;