X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FResponse.pm;h=709f0adac33f369e834fbde445762d2ed47a2eaf;hb=55f8e5163b1f5c502b92a9976350c611610c80e3;hp=f049ebfab77184ed4c5eecf1454ffeee8f1e0e7a;hpb=efeeb25772af5f67012ed1fdbef9a9d4e01ad64c;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Response.pm b/lib/Catalyst/Response.pm index f049ebf..709f0ad 100644 --- a/lib/Catalyst/Response.pm +++ b/lib/Catalyst/Response.pm @@ -4,6 +4,7 @@ use Moose; use HTTP::Headers; use Moose::Util::TypeConstraints; use namespace::autoclean; +use Scalar::Util 'blessed'; with 'MooseX::Emulate::Class::Accessor::Fast'; @@ -116,6 +117,9 @@ sub finalize_headers { sub from_psgi_response { my ($self, $psgi_res) = @_; + if(blessed($psgi_res) && $psgi_res->can('as_psgi')) { + $psgi_res = $psgi_res->as_psgi; + } if(ref $psgi_res eq 'ARRAY') { my ($status, $headers, $body) = @$psgi_res; $self->status($status); @@ -430,6 +434,8 @@ a $responder) set the response from it. Properly supports streaming and delayed response and / or async IO if running under an expected event loop. +If passed an object, will expect that object to do a method C. + Example: package MyApp::Web::Controller::Test;