X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=034eb1052ab4df97f2aa7f0c68058ccc8804e4ae;hp=790f2c93b6b7c27f210b8eca0078f404b90fd46e;hb=4f5ebacdba8bc446f80d0e8999d117d80f9d2c98;hpb=26e731318112842b5a605bec2092ccae3369c5e4 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 790f2c9..034eb10 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -805,7 +805,6 @@ sub prepare { arguments => [], body_parameters => {}, cookies => {}, - handle => \*STDIN, headers => HTTP::Headers->new, parameters => {}, query_parameters => {}, @@ -818,7 +817,6 @@ sub prepare { { body => '', cookies => {}, - handle => \*STDOUT, headers => HTTP::Headers->new(), status => 200 } @@ -910,8 +908,8 @@ Prepare a chunk of data before sending it to HTTP::Body. =cut -sub prepare_body_chunk { - my $c = shift; +sub prepare_body_chunk { + my $c = shift; $c->engine->prepare_body_chunk( $c, @_ ); } @@ -1353,7 +1351,14 @@ data, if known. =cut -sub write { my $c = shift; return $c->engine->write( $c, @_ ) } +sub write { + my $c = shift; + + # Finalize headers if someone manually writes output + $c->finalize_headers; + + return $c->engine->write( $c, @_ ); +} =back