X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FEngine%2FApache%2FMP19%2FBase.pm;h=9680724c7aec9ecfa808a4d8363b0e3b87e88dcb;hp=0a08ba179a6f20e19ed387c5e32a2d104dedef06;hb=566ee5d777a655fce380b8fe864a99809f7c8e04;hpb=77d12cae061a244f2816e11e593b1235248756c9 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; }