sub code { shift->status(@_) }
-=head2 $self->write($buffer)
-
-Writes the buffer to the client.
-
-=cut
-
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;
return $len;
}
-=head2 $self->finalize_headers($c)
-
-Abstract method, allows engines to write headers to response
-
-=cut
-
sub finalize_headers {
my ($self) = @_;
Prints @data to the output stream, separated by $,. This lets you pass
the response object to functions that want to write to an L<IO::Handle>.
+=head2 $self->finalize_headers($c)
+
+Writes headers to response if not already written
+
=head2 DEMOLISH
Ensures that the response is flushed and closed at the end of the