You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ICS.UCI.EDU> on 1997/03/29 06:10:27 UTC

Re: Server-generated content-type?

Ken writes:
>    Working on mod_example, the handler of which emits text/plain
>    content, I found I was having trouble getting the Content-type
>    header sent to the client correctly.  No matter what I did, Apache
>    would rewrite this header to "text/html".  I finally stole a
>    workaround from another module and now force *my* setting to be sent
>    by calling send_http_header() at the beginning of the handler
>    routine.

Why don't you just set r->content_type?  The behavior is ancient, as far
as I can tell, but it would be easy to add a check for an existing
Content-Type before setting it to the default_type.

>    I can't find any reference to this behaviour; is the server
>    *supposed* to force "text/html" on all outbound server-generated
>    content? 

Only if no r->content_type and the default type is "text/html".  It should
say that in API.html, but doesn't.

....Roy