From: Tomas Doran Date: Thu, 13 May 2010 08:11:09 +0000 (+0200) Subject: Back compat fix for Gitalist X-Git-Tag: 0.85~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Action-REST.git;a=commitdiff_plain;h=96eccfebd3e6e7975b48a92d4680f77182896775 Back compat fix for Gitalist Views don't render 3XX responses as you don't care if you're in a browser, whereas normal structured serialization methods (e.g. JSON) do probably want to render an entity. --- diff --git a/Changes b/Changes index 6b23083..3147b95 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,13 @@ +Thu 13 May 2010 10:09:19 CEST - Release 0.85 + + Make Catalyst::Action::Serialize::View return directly rather than serializing + a response for 3XX status codes. This stops back-compat breakage from the + previous change (in 0.84), whilst also allowing actual data serializers + to still handle 3XX. + Fix docs in Catalyst::TraitFor::Request::REST::ForBrowsers. (RT#54983) -Thu 6 May 2010 09:27:56 - Release 0.84 +Thu 6 May 2010 09:27:56 BST - Release 0.84 Revert always using a trait rather than Catalyst::Request::REST to improve debug messages. diff --git a/lib/Catalyst/Action/Serialize/View.pm b/lib/Catalyst/Action/Serialize/View.pm index fbfa7f4..1cc4bf6 100644 --- a/lib/Catalyst/Action/Serialize/View.pm +++ b/lib/Catalyst/Action/Serialize/View.pm @@ -11,6 +11,10 @@ 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'} :