Fixed MP2, removed dependency of libapreq in MP engines, fixed C::E::C::APR
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / Apache / MP20 / Base.pm
CommitLineData
316bf0f0 1package Catalyst::Engine::Apache::MP20::Base;
2
3use strict;
4use base 'Catalyst::Engine::Apache::Base';
5
6use Apache2::Connection ();
7use Apache2::Const ();
8use Apache2::RequestIO ();
9use Apache2::RequestRec ();
10use Apache2::RequestUtil ();
11
12Apache2::Const->import( -compile => ':common' );
13
14=head1 NAME
15
16Catalyst::Engine::Apache::MP20::Base - Base class for MP 2.0 Engines
17
18=head1 SYNOPSIS
19
20See L<Catalyst>.
21
22=head1 DESCRIPTION
23
24This is a base class for MP 2.0 Engines.
25
26=head1 OVERLOADED METHODS
27
28This class overloads some methods from C<Catalyst::Engine::Apache::Base>.
29
30=over 4
31
32=item $c->finalize_headers
33
34=cut
35
36sub finalize_headers {
37 my $c = shift;
38
39 for my $name ( $c->response->headers->header_field_names ) {
40 next if $name =~ /Content-Type/i;
41 my @values = $c->response->header($name);
42 $c->apache->headers_out->add( $name => $_ ) for @values;
43 }
44
45 if ( $c->response->header('Set-Cookie') && $c->response->status >= 300 ) {
46 my @values = $c->response->header('Set-Cookie');
47 $c->apache->err_headers_out->add( 'Set-Cookie' => $_ ) for @values;
48 }
49
50 $c->apache->status( $c->response->status );
51 $c->apache->content_type( $c->response->header('Content-Type') );
52
53 return 0;
54}
55
56=item $c->handler
57
58=cut
59
60sub handler : method {
61 shift->SUPER::handler(@_);
62}
63
64=back
65
66=head1 SEE ALSO
67
68L<Catalyst>, L<Catalyst::Engine>, L<Catalyst::Engine::Apache::Base>.
69
70=head1 AUTHOR
71
72Sebastian Riedel, C<sri@cpan.org>
73Christian Hansen C<ch@ngmedia.com>
74
75=head1 COPYRIGHT
76
77This program is free software, you can redistribute it and/or modify it under
78the same terms as Perl itself.
79
80=cut
81
821;