Fix CPAN RT#76179
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Response.pm
index 185dc99..eebe22c 100644 (file)
@@ -53,17 +53,11 @@ sub output { shift->body(@_) }
 
 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;
 
     $buffer = q[] unless defined $buffer;
 
@@ -73,12 +67,6 @@ sub write {
     return $len;
 }
 
-=head2 $self->finalize_headers($c)
-
-Abstract method, allows engines to write headers to response
-
-=cut
-
 sub finalize_headers {
     my ($self) = @_;
 
@@ -263,6 +251,10 @@ Writes $data to the output stream.
 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