From: Christian Hansen Date: Tue, 17 May 2005 21:45:49 +0000 (+0000) Subject: Renamed C::E::A::MPXX::APR to ::Apreq X-Git-Tag: 5.7099_04~1382 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=566ee5d777a655fce380b8fe864a99809f7c8e04 Renamed C::E::A::MPXX::APR to ::Apreq --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index be14489..44726fc 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -167,7 +167,7 @@ sub import { $engine = 'Catalyst::Engine::Apache::MP20'; if ( Apache2::Request->require ) { - $engine = 'Catalyst::Engine::Apache::MP20::APR'; + $engine = 'Catalyst::Engine::Apache::MP20::Apreq'; } } @@ -176,7 +176,7 @@ sub import { $engine = 'Catalyst::Engine::Apache::MP19'; if ( Apache::Request->require ) { - $engine = 'Catalyst::Engine::Apache::MP19::APR'; + $engine = 'Catalyst::Engine::Apache::MP19::Apreq'; } } @@ -185,7 +185,7 @@ sub import { $engine = 'Catalyst::Engine::Apache::MP13'; if ( Apache::Request->require ) { - $engine = 'Catalyst::Engine::Apache::MP13::APR'; + $engine = 'Catalyst::Engine::Apache::MP13::Apreq'; } } diff --git a/lib/Catalyst/Engine/Apache/MP13/APR.pm b/lib/Catalyst/Engine/Apache/MP13/Apreq.pm similarity index 92% rename from lib/Catalyst/Engine/Apache/MP13/APR.pm rename to lib/Catalyst/Engine/Apache/MP13/Apreq.pm index 1867b1b..d428233 100644 --- a/lib/Catalyst/Engine/Apache/MP13/APR.pm +++ b/lib/Catalyst/Engine/Apache/MP13/Apreq.pm @@ -1,4 +1,4 @@ -package Catalyst::Engine::Apache::MP13::APR; +package Catalyst::Engine::Apache::MP13::Apreq; use strict; use base 'Catalyst::Engine::Apache::MP13::Base'; @@ -7,7 +7,7 @@ use Apache::Request (); =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 diff --git a/lib/Catalyst/Engine/Apache/MP13/Base.pm b/lib/Catalyst/Engine/Apache/MP13/Base.pm index ca38f40..e22e408 100644 --- a/lib/Catalyst/Engine/Apache/MP13/Base.pm +++ b/lib/Catalyst/Engine/Apache/MP13/Base.pm @@ -5,6 +5,7 @@ use base 'Catalyst::Engine::Apache::Base'; use Apache (); use Apache::Constants (); +use Apache::File (); Apache::Constants->import(':common'); @@ -34,7 +35,7 @@ sub finalize_headers { 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; } @@ -45,7 +46,14 @@ sub finalize_headers { } $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; diff --git a/lib/Catalyst/Engine/Apache/MP19/APR.pm b/lib/Catalyst/Engine/Apache/MP19/Apreq.pm similarity index 93% rename from lib/Catalyst/Engine/Apache/MP19/APR.pm rename to lib/Catalyst/Engine/Apache/MP19/Apreq.pm index b8c507d..3c98df4 100644 --- a/lib/Catalyst/Engine/Apache/MP19/APR.pm +++ b/lib/Catalyst/Engine/Apache/MP19/Apreq.pm @@ -1,4 +1,4 @@ -package Catalyst::Engine::Apache::MP19::APR; +package Catalyst::Engine::Apache::MP19::Apreq; use strict; use base 'Catalyst::Engine::Apache::MP19::Base'; @@ -8,7 +8,7 @@ use Apache::Upload (); =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 diff --git a/lib/Catalyst/Engine/Apache/MP19/Base.pm b/lib/Catalyst/Engine/Apache/MP19/Base.pm index 0a08ba1..9680724 100644 --- a/lib/Catalyst/Engine/Apache/MP19/Base.pm +++ b/lib/Catalyst/Engine/Apache/MP19/Base.pm @@ -9,6 +9,7 @@ use Apache::Const (); use Apache::RequestIO (); use Apache::RequestRec (); use Apache::RequestUtil (); +use Apache::Response (); Apache::Const->import( -compile => ':common' ); @@ -38,7 +39,7 @@ sub finalize_headers { 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; } @@ -49,7 +50,14 @@ sub finalize_headers { } $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; } diff --git a/lib/Catalyst/Engine/Apache/MP20/APR.pm b/lib/Catalyst/Engine/Apache/MP20/Apreq.pm similarity index 93% rename from lib/Catalyst/Engine/Apache/MP20/APR.pm rename to lib/Catalyst/Engine/Apache/MP20/Apreq.pm index a7352c5..4716d7a 100644 --- a/lib/Catalyst/Engine/Apache/MP20/APR.pm +++ b/lib/Catalyst/Engine/Apache/MP20/Apreq.pm @@ -1,4 +1,4 @@ -package Catalyst::Engine::Apache::MP20::APR; +package Catalyst::Engine::Apache::MP20::Apreq; use strict; use base 'Catalyst::Engine::Apache::MP20::Base'; @@ -8,7 +8,7 @@ use Apache2::Upload (); =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 diff --git a/lib/Catalyst/Engine/Apache/MP20/Base.pm b/lib/Catalyst/Engine/Apache/MP20/Base.pm index 72b111d..a719b95 100644 --- a/lib/Catalyst/Engine/Apache/MP20/Base.pm +++ b/lib/Catalyst/Engine/Apache/MP20/Base.pm @@ -8,6 +8,7 @@ use Apache2::Const (); use Apache2::RequestIO (); use Apache2::RequestRec (); use Apache2::RequestUtil (); +use Apache2::Response (); Apache2::Const->import( -compile => ':common' ); @@ -37,7 +38,7 @@ sub finalize_headers { 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; } @@ -48,7 +49,14 @@ sub finalize_headers { } $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; } diff --git a/lib/Catalyst/Engine/FastCGI.pm b/lib/Catalyst/Engine/FastCGI.pm index 1bf8d18..2d11b44 100644 --- a/lib/Catalyst/Engine/FastCGI.pm +++ b/lib/Catalyst/Engine/FastCGI.pm @@ -29,7 +29,8 @@ This is the Catalyst engine for FastCGI. =head1 OVERLOADED METHODS -This class overloads some methods from C. +This class overloads some methods from C +and C. =over 4 diff --git a/lib/Catalyst/Engine/SpeedyCGI.pm b/lib/Catalyst/Engine/SpeedyCGI.pm index 4735cd4..85f19d7 100644 --- a/lib/Catalyst/Engine/SpeedyCGI.pm +++ b/lib/Catalyst/Engine/SpeedyCGI.pm @@ -29,7 +29,8 @@ This is the Catalyst engine for SpeedyCGI. =head1 OVERLOADED METHODS -This class overloads some methods from C. +This class overloads some methods from C +and C. =over 4