1 package Catalyst::Engine::Apache::MP20::Base;
4 use base 'Catalyst::Engine::Apache::Base';
6 use Apache2::Connection ();
8 use Apache2::RequestIO ();
9 use Apache2::RequestRec ();
10 use Apache2::RequestUtil ();
11 use Apache2::Response ();
13 Apache2::Const->import( -compile => ':common' );
17 Catalyst::Engine::Apache::MP20::Base - Base class for MP 2.0 Engines
25 This is a base class for MP 2.0 Engines.
27 =head1 OVERLOADED METHODS
29 This class overloads some methods from C<Catalyst::Engine::Apache::Base>.
33 =item $c->finalize_headers
37 sub finalize_headers {
40 for my $name ( $c->response->headers->header_field_names ) {
41 next if $name =~ /^Content-(Length|Type)$/i;
42 my @values = $c->response->header($name);
43 $c->apache->headers_out->add( $name => $_ ) for @values;
46 if ( $c->response->header('Set-Cookie') && $c->response->status >= 300 ) {
47 my @values = $c->response->header('Set-Cookie');
48 $c->apache->err_headers_out->add( 'Set-Cookie' => $_ ) for @values;
51 $c->apache->status( $c->response->status );
53 if ( my $type = $c->response->header('Content-Type') ) {
54 $c->apache->content_type($type);
57 if ( my $length = $c->response->content_length ) {
58 $c->apache->set_content_length($length);
68 sub handler : method {
69 shift->SUPER::handler(@_);
76 L<Catalyst>, L<Catalyst::Engine>, L<Catalyst::Engine::Apache::Base>.
80 Sebastian Riedel, C<sri@cpan.org>
81 Christian Hansen C<ch@ngmedia.com>
85 This program is free software, you can redistribute it and/or modify it under
86 the same terms as Perl itself.