X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FSerialize%2FView.pm;h=43c51f6d87760cb70aaa31a610f6634a7551d43f;hb=1f22d6b363c1287923ac8333ebc67b6d0d735786;hp=7fd2cdcf94ab197a222558b66432e4323b54fdda;hpb=6edee33e277b917de955266e0e7634e7cd830cd9;p=catagits%2FCatalyst-Action-REST.git diff --git a/lib/Catalyst/Action/Serialize/View.pm b/lib/Catalyst/Action/Serialize/View.pm index 7fd2cdc..43c51f6 100644 --- a/lib/Catalyst/Action/Serialize/View.pm +++ b/lib/Catalyst/Action/Serialize/View.pm @@ -4,13 +4,17 @@ use namespace::autoclean; extends 'Catalyst::Action'; -our $VERSION = '0.81'; +our $VERSION = '0.97'; $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'} : @@ -33,4 +37,6 @@ sub execute { } } +__PACKAGE__->meta->make_immutable; + 1;