X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FSerialize%2FView.pm;h=21acd8e4b483420a74f659dff264b71e57a45d53;hb=8004a60b5d676a98f1a9d5cb1ad6a63ac6402617;hp=286fc889ca3d8eb723f9b1facb8450c5d87419e7;hpb=6d4a379ff0469458a48076dc5bc2cf0e159dd645;p=catagits%2FCatalyst-Action-REST.git diff --git a/lib/Catalyst/Action/Serialize/View.pm b/lib/Catalyst/Action/Serialize/View.pm index 286fc88..21acd8e 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 = '1.00'; +$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;