You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by blitp <bl...@proton.me> on 2025/12/01 01:32:41 UTC

[users@httpd] custom module ErrorDocument body

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.

is it possible to set the body from my module?
or maybe override the ErrorDocument value for that request?

i'm trying to avoid editing httpd.conf to set it, as it would affect other 307 responses, including ones that my module is not responsible for.

thanks ^.^

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] custom module ErrorDocument body

Posted by Eric Covener <co...@gmail.com>.
On Sun, Nov 30, 2025 at 8:33 PM blitp <bl...@proton.me> 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.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org