Boris Zentner wrote:
> Hi,
> 
> I have a handler, that serve dynamic pages or static ones. If the handler gets 
> a HEAD request, it answers with
> 
>   ...
>   $apr->headers_out->{'Content-Length'} = 12345;
>   $apr->content_type($media_type) unless $apr->main;
>   if ( $apr->header_only ) {
>     return DONE;
>   }
>   ...
> 
> This works, but the Content-Length header is removed by someone. I do not use 
> any filters and even when, there is no body of the message.
> 
> Who strips my Content-Length header?

it could be anyone, from some C filter (like mod_include) to apache core.

> 
> How to find who modified my headers?

use the force, read the source :)

> 
> Is this a bug or a desired behavior?

it is desired - you no longer need to set the Content-Length header for
requests in Apache 2.0.

basically, any C-L header you set in the content-generation phase of the
request has the potential to be incorrect, since any filter can come along
and alter the content.  so, what apache does is it runs the new
content-length filter, which will decide whether a C-L header is required
and take appropriate steps.  for instance, apache will abandon the C-L
header if it decides it can use a chunked transfer encoding instead.

HTH

--Geoff

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to