$engine = 'Catalyst::Engine::Apache::MP20';
if ( Apache2::Request->require ) {
- $engine = 'Catalyst::Engine::Apache::MP20::APR';
+ $engine = 'Catalyst::Engine::Apache::MP20::Apreq';
}
}
$engine = 'Catalyst::Engine::Apache::MP19';
if ( Apache::Request->require ) {
- $engine = 'Catalyst::Engine::Apache::MP19::APR';
+ $engine = 'Catalyst::Engine::Apache::MP19::Apreq';
}
}
$engine = 'Catalyst::Engine::Apache::MP13';
if ( Apache::Request->require ) {
- $engine = 'Catalyst::Engine::Apache::MP13::APR';
+ $engine = 'Catalyst::Engine::Apache::MP13::Apreq';
}
}
-package Catalyst::Engine::Apache::MP13::APR;
+package Catalyst::Engine::Apache::MP13::Apreq;
use strict;
use base 'Catalyst::Engine::Apache::MP13::Base';
=head1 NAME
-Catalyst::Engine::Apache::MP13::APR - APR class for MP 1.3 Engines
+Catalyst::Engine::Apache::MP13::Apreq - Apreq class for MP 1.3 Engines
=head1 SYNOPSIS
use Apache ();
use Apache::Constants ();
+use Apache::File ();
Apache::Constants->import(':common');
my $c = shift;
for my $name ( $c->response->headers->header_field_names ) {
- next if $name =~ /Content-Type/i;
+ next if $name =~ /^Content-(Length|Type)$/i;
my @values = $c->response->header($name);
$c->apache->headers_out->add( $name => $_ ) for @values;
}
}
$c->apache->status( $c->response->status );
- $c->apache->content_type( $c->response->header('Content-Type') );
+
+ if ( my $type = $c->response->header('Content-Type') ) {
+ $c->apache->content_type($type);
+ }
+
+ if ( my $length = $c->response->content_length ) {
+ $c->apache->set_content_length($length);
+ }
$c->apache->send_http_header;
-package Catalyst::Engine::Apache::MP19::APR;
+package Catalyst::Engine::Apache::MP19::Apreq;
use strict;
use base 'Catalyst::Engine::Apache::MP19::Base';
=head1 NAME
-Catalyst::Engine::Apache::MP19::APR - APR class for MP 1.9 Engines
+Catalyst::Engine::Apache::MP19::Apreq - Apreq class for MP 1.9 Engines
=head1 SYNOPSIS
use Apache::RequestIO ();
use Apache::RequestRec ();
use Apache::RequestUtil ();
+use Apache::Response ();
Apache::Const->import( -compile => ':common' );
my $c = shift;
for my $name ( $c->response->headers->header_field_names ) {
- next if $name =~ /Content-Type/i;
+ next if $name =~ /^Content-(Length|Type)$/i;
my @values = $c->response->header($name);
$c->apache->headers_out->add( $name => $_ ) for @values;
}
}
$c->apache->status( $c->response->status );
- $c->apache->content_type( $c->response->header('Content-Type') );
+
+ if ( my $type = $c->response->header('Content-Type') ) {
+ $c->apache->content_type($type);
+ }
+
+ if ( my $length = $c->response->content_length ) {
+ $c->apache->set_content_length($length);
+ }
return 0;
}
-package Catalyst::Engine::Apache::MP20::APR;
+package Catalyst::Engine::Apache::MP20::Apreq;
use strict;
use base 'Catalyst::Engine::Apache::MP20::Base';
=head1 NAME
-Catalyst::Engine::Apache::MP20 - APR class for MP 2.0 Engines
+Catalyst::Engine::Apache::MP20::Apreq - Apreq class for MP 2.0 Engines
=head1 SYNOPSIS
use Apache2::RequestIO ();
use Apache2::RequestRec ();
use Apache2::RequestUtil ();
+use Apache2::Response ();
Apache2::Const->import( -compile => ':common' );
my $c = shift;
for my $name ( $c->response->headers->header_field_names ) {
- next if $name =~ /Content-Type/i;
+ next if $name =~ /^Content-(Length|Type)$/i;
my @values = $c->response->header($name);
$c->apache->headers_out->add( $name => $_ ) for @values;
}
}
$c->apache->status( $c->response->status );
- $c->apache->content_type( $c->response->header('Content-Type') );
+
+ if ( my $type = $c->response->header('Content-Type') ) {
+ $c->apache->content_type($type);
+ }
+
+ if ( my $length = $c->response->content_length ) {
+ $c->apache->set_content_length($length);
+ }
return 0;
}
=head1 OVERLOADED METHODS
-This class overloads some methods from C<Catalyst::Engine::FastCGI::Base>.
+This class overloads some methods from C<Catalyst::Engine::FastCGI::Base>
+and C<Catalyst::Engine::CGI>.
=over 4
=head1 OVERLOADED METHODS
-This class overloads some methods from C<Catalyst::Engine::SpeedyCGI::Base>.
+This class overloads some methods from C<Catalyst::Engine::SpeedyCGI::Base>
+and C<Catalyst::Engine::CGI>.
=over 4