X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FSerialize%2FView.pm;h=1c19926ade524a1746b8836cc82b41d2e24dedc6;hb=f51d80cd61f44b096583756f2ce20e9ad5878239;hp=7fd2cdcf94ab197a222558b66432e4323b54fdda;hpb=6edee33e277b917de955266e0e7634e7cd830cd9;p=catagits%2FCatalyst-Action-Serialize-Data-Serializer.git diff --git a/lib/Catalyst/Action/Serialize/View.pm b/lib/Catalyst/Action/Serialize/View.pm index 7fd2cdc..1c19926 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.93'; $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;