X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FResponse.pm;h=6dc661e534ff6e77c5fca073fdea20ce6d057bc1;hb=f0580bff341c3d9a8a62bb8e670ff8772745786f;hp=cd818579615e578d82d6765afd9625165b1d60ca;hpb=8738b8fecb20f3761d76a8d7f46660fdae54993a;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Response.pm b/lib/Catalyst/Response.pm index cd81857..6dc661e 100644 --- a/lib/Catalyst/Response.pm +++ b/lib/Catalyst/Response.pm @@ -43,6 +43,11 @@ has headers => ( required => 1, lazy => 1, ); +has _context => ( + is => 'rw', + weak_ref => 1, + clearer => '_clear_context', +); sub output { shift->body(@_) } @@ -52,7 +57,7 @@ sub write { my ( $self, $buffer ) = @_; # Finalize headers if someone manually writes output - $self->finalize_headers; + $self->_context->finalize_headers unless $self->finalized_headers; $buffer = q[] unless defined $buffer;