Re: ap_custom_response content type 'text/xml'

Top Page

Reply to this message
Author: Jeff Trawick
Date:  
To: dev
Subject: Re: ap_custom_response content type 'text/xml'
On Thu, Jun 26, 2008 at 3:33 AM, Kiffin Gish <Kiffin.Gish@???> wrote:

> In order to reply with my own xml error, I want to use
> ap_custom_response(r, HTTP_INTERNAL_SERVER_ERROR, xml);
>
> However, default content type is "text/html". If I try to change it by
> using ap_set_content_type(r, "text/xml"), this has no effect.
>

(The ap_custom_response() API is busted and needs to allow (FORCE) the
caller to pass in the content type/charset to associate with the response
text.)

You can pass a URI to ap_custom_response (as on the ErrorDocument directive)
to redirect error requests to a special uri space, and implement a handler
for those which can control the response more fully.

(Hopefully there are some better ideas out there.)