On 29 Aug 2011, at 23:21, Peter Glasten wrote:Since this is a development question, it would be more on-topic
> Hello!
>
> In my Apache module
for the modules-dev list than here.
That depends on how/where your module triggers the 302 response.
> (module AP_MODULE_DECLARE_DATA ... etc etc - low-level Apache module written in C) I need to return a 302 redirect status with no body, Content-Length set to zero, and no content-type (this is a third-party requirement that I cannot change). Apache by default adds hard-coded HTML body and text/html content type.
If it does so by returning 302 from a pre-handler hook (like, for example,
mod_alias and mod_rewrite do) then you get what you describe.
If it works as a handler like CGI or PHP, then you (can easily)
get what you want and expect. Take a look at mod_asis for a
startingpoint to do it that way.
Alternatively (and unless your module is doing something v.strange)
you should be able to delegate the 302 response to the server admin.
Your module just sets a Location and returns 302, but you can use the
ErrorDocument directive to customise your response. With a .asis
ErrorDocument you have full control over the headers.
Note that Content-Length: 0 is redundant, in the absence of anything
that would lead a client to expect contents.
See also the book: http://www.apachetutor.org/
--
Nick Kew