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