Renamed C::E::A::MPXX::APR to ::Apreq
Christian Hansen [Tue, 17 May 2005 21:45:49 +0000 (21:45 +0000)]
lib/Catalyst.pm
lib/Catalyst/Engine/Apache/MP13/Apreq.pm [moved from lib/Catalyst/Engine/Apache/MP13/APR.pm with 92% similarity]
lib/Catalyst/Engine/Apache/MP13/Base.pm
lib/Catalyst/Engine/Apache/MP19/Apreq.pm [moved from lib/Catalyst/Engine/Apache/MP19/APR.pm with 93% similarity]
lib/Catalyst/Engine/Apache/MP19/Base.pm
lib/Catalyst/Engine/Apache/MP20/Apreq.pm [moved from lib/Catalyst/Engine/Apache/MP20/APR.pm with 93% similarity]
lib/Catalyst/Engine/Apache/MP20/Base.pm
lib/Catalyst/Engine/FastCGI.pm
lib/Catalyst/Engine/SpeedyCGI.pm

index be14489..44726fc 100644 (file)
@@ -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';
                 }
             }
 
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 (file)
@@ -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
 
index ca38f40..e22e408 100644 (file)
@@ -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;
 
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 (file)
@@ -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
 
index 0a08ba1..9680724 100644 (file)
@@ -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;
 }
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 (file)
@@ -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
 
index 72b111d..a719b95 100644 (file)
@@ -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;
 }
index 1bf8d18..2d11b44 100644 (file)
@@ -29,7 +29,8 @@ This is the Catalyst engine for FastCGI.
 
 =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
 
index 4735cd4..85f19d7 100644 (file)
@@ -29,7 +29,8 @@ This is the Catalyst engine for SpeedyCGI.
 
 =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