Re: custom module ErrorDocument body

Eric Covener <[email protected]> Sun, 30 Nov 2025 20:39:53 -0500
Newsgroups gmane.comp.apache.user
Message-ID <CALK=YjNxE1W=BiKupGFqgcMdXq19KZougVJnujYQziiQv29M_A@mail.gmail.com>
On Sun, Nov 30, 2025 at 8:33=E2=80=AFPM blitp <[email protected]> wrote:
>
> hello,
> got a little question please.
>
> i'm creating a module that sets a 307 http response header, and it works =
fine.
> i'm also setting the response body, but apache overrides it.
> it uses the default ErrorDocument directive.

Are you doing this during the handler phase or earlier? In a handler
you'd want to set r->status to 307, but not return 307 (return OK)
which might cause what you described.

If you are making your decision earlier, you might implement a handler
just to return the response and set the status, saving some state in
your module request_config or by setting/checking r->handler.  This is
something like what mod_rewrite does with "handler_redirect" because
it can't do what it wants in the early phases most of mod_rewrite acts
in.