httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Marantz <>
Subject Re: Determining mimetype of document
Date Fri, 08 Jun 2012 21:23:59 GMT
In understand any module *can* set content-type late: I'm just wondering if
that happens with any frequency.  E.g.when I googled for how to set
content-type in Apache, I got references to AddType and some hacks using
mod_rewrite, both of which would run upstream of my filter.  My main
concern is mod_headers since it runs downstream.

RE firefox sniffing content-type:  does that imply that if there is an
explicit mimetype it will ignore it and determine XHTML vs HTML via
sniffing, I suppose, for DOCTYPE?  Do you have a link to that bit of news?
 That certainly complicates things.


On Fri, Jun 8, 2012 at 5:16 PM, Joe Lewis <> wrote:

> On 06/08/2012 03:07 PM, Joshua Marantz wrote:
>> Hi,
>> I'm trying to figure out whether my filter, which currently runs upstream
>> of mod_headers, is likely to see the correct mimetype
>> in request->content_type.
>> In particular, we need to know whether browsers will interpret the content
>> as XHTML or HTML, which is determined by the mimetype.  Do people
>> typically
>> set the mimetype using mod_headers, or is that typically set using AddType
>> or some other mechanism?
> It's usually set by the content generator.  However, you have to keep in
> mind that any module may modify that value (any output filter may, too) up
> until the AP_FTYPE_CONTENT_SET (runs after the AP_FTYPE_RESOURCE output
> filters).
> Additionally, please keep in mind that Firefox has begun the old I.E. hack
> of sniffing the content and ignoring the Content-Type header if it can
> figure it out, so you will have to be aware that content_type is not
> indicative at any stage of what the browser is going to do.
> Joe
> --

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message