Added $c->request->uri
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / Apache / MP13 / Base.pm
CommitLineData
316bf0f0 1package Catalyst::Engine::Apache::MP13::Base;
2
3use strict;
4use base 'Catalyst::Engine::Apache::Base';
5
6use Apache ();
7use Apache::Constants ();
8
9Apache::Constants->import(':common');
10
11=head1 NAME
12
13Catalyst::Engine::Apache::MP13::Base - Base class for MP 1.3 Engines
14
15=head1 SYNOPSIS
16
17See L<Catalyst>.
18
19=head1 DESCRIPTION
20
21This is a base class for MP 1.3 Engines.
22
23=head1 OVERLOADED METHODS
24
25This class overloads some methods from C<Catalyst::Engine::Apache::Base>.
26
27=over 4
28
29=item $c->finalize_headers
30
31=cut
32
33sub 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
59sub handler ($$) {
60 shift->SUPER::handler(@_);
61}
62
63=back
64
65=head1 SEE ALSO
66
67L<Catalyst>, L<Catalyst::Engine>, L<Catalyst::Engine::Apache::Base>.
68
69=head1 AUTHOR
70
71Sebastian Riedel, C<sri@cpan.org>
72Christian Hansen C<ch@ngmedia.com>
73
74=head1 COPYRIGHT
75
76This program is free software, you can redistribute it and/or modify it under
77the same terms as Perl itself.
78
79=cut
80
811;