X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FSerialize%2FView.pm;h=36d23eb15199f0b7a30b6771cc238c63d55084cd;hb=f2d343397851d96c2081f6f753293c74899ef009;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..36d23eb 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.94'; +$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;