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;