X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=8103db93d7aec4756b3a37cbdad57385bdb7ef78;hb=8199eac32fd36ac2eb0754ef934d7159de23277d;hp=4ee787e4400aade63ffd7d4ab4ae7ab836706dc8;hpb=fbcc39ad23f2bbecf5d84c9ba581e6af86fcd460;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 4ee787e..8103db9 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -119,7 +119,7 @@ so C becomes C. use Catalyst 'My::Module'; -Special flags like -Debug and -Engine can also be specifed as arguments when +Special flags like -Debug and -Engine can also be specified as arguments when Catalyst is loaded: use Catalyst qw/-Debug My::Module/; @@ -392,7 +392,7 @@ sub uri_for { my $base = $c->request->base->clone; my $basepath = $base->path; $basepath =~ s/\/$//; - $basepath .= '/' if $basepath; + $basepath .= '/'; my $match = $c->request->match; $match =~ s/^\///; $match .= '/' if $match; @@ -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 } @@ -904,6 +902,17 @@ sub prepare_body { } } +=item $c->prepare_body_chunk( $chunk ) + +Prepare a chunk of data before sending it to HTTP::Body. + +=cut + +sub prepare_body_chunk { + my $c = shift; + $c->engine->prepare_body_chunk( $c, @_ ); +} + =item $c->prepare_body_parameters Prepare body parameters. @@ -1342,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 @@ -1489,6 +1505,8 @@ Tatsuhiko Miyagawa Ulf Edvinsson +Yuval Kogman + =head1 AUTHOR Sebastian Riedel, C