X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=5e87e9f62604d9171956171ec853360adf7761b5;hp=e4deb9e309b8a855d1317066fb8185ee38f9ecf3;hb=9c056c82094f7550ac9e39408c52d248bcace7b3;hpb=1728aeb70afd529fb0f529eedf1c117751173e6d diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index e4deb9e..5e87e9f 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -159,11 +159,11 @@ sub finalize_body { } else { - # Case where body was set afgter calling ->write. We'd prefer not to + # Case where body was set after calling ->write. We'd prefer not to # support this, but I can see some use cases with the way most of the - # views work. - - $self->write($c, $body ); + # views work. Since body has already been encoded, we need to do + # an 'unencoded_write' here. + $self->unencoded_write( $c, $body ); } } @@ -700,6 +700,20 @@ sub write { $c->response->write($buffer); } +=head2 $self->unencoded_write($c, $buffer) + +Writes the buffer to the client without encoding. Necessary for +already encoded buffers. Used when a $c->write has been done +followed by $c->res->body. + +=cut + +sub unencoded_write { + my ( $self, $c, $buffer ) = @_; + + $c->response->unencoded_write($buffer); +} + =head2 $self->read($c, [$maxlength]) Reads from the input stream by calling C<< $self->read_chunk >>.