Added $c->request->uri
[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 ();
12
13Apache::Const->import( -compile => ':common' );
14
15=head1 NAME
16
17Catalyst::Engine::Apache::MP19::Base - Base class for MP 1.9 Engines
18
19=head1 SYNOPSIS
20
21See L<Catalyst>.
22
23=head1 DESCRIPTION
24
25This is a base class for MP 1.99 Engines.
26
27=head1 OVERLOADED METHODS
28
29This class overloads some methods from C<Catalyst::Engine::Apache::Base>.
30
31=over 4
32
33=item $c->finalize_headers
34
35=cut
36
37sub finalize_headers {
38 my $c = shift;
39
40 for my $name ( $c->response->headers->header_field_names ) {
41 next if $name =~ /Content-Type/i;
42 my @values = $c->response->header($name);
43 $c->apache->headers_out->add( $name => $_ ) for @values;
44 }
45
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;
49 }
50
51 $c->apache->status( $c->response->status );
52 $c->apache->content_type( $c->response->header('Content-Type') );
53
54 return 0;
55}
56
57=item $c->handler
58
59=cut
60
61sub handler : method {
62 shift->SUPER::handler(@_);
63}
64
65=back
66
67=head1 SEE ALSO
68
69L<Catalyst>, L<Catalyst::Engine>, L<Catalyst::Engine::Apache::Base>.
70
71=head1 AUTHOR
72
73Sebastian Riedel, C<sri@cpan.org>
74Christian Hansen C<ch@ngmedia.com>
75
76=head1 COPYRIGHT
77
78This program is free software, you can redistribute it and/or modify it under
79the same terms as Perl itself.
80
81=cut
82
831;