X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAction%2FSerialize%2FView.pm;h=64872f7fa3eb68a095350a6901bba4f5da61a638;hb=refs%2Ftags%2F1.04;hp=bce99334f35d849eb14ce24ec1afebce9903f234;hpb=a042dad01479cdd9e5e2c6e8581d2cdd0f604fa7;p=catagits%2FCatalyst-Action-REST.git diff --git a/lib/Catalyst/Action/Serialize/View.pm b/lib/Catalyst/Action/Serialize/View.pm index bce9933..64872f7 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.83'; +our $VERSION = '1.04'; $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;