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