Return-Path: X-Original-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7ADD99C76 for ; Fri, 8 Jun 2012 21:35:40 +0000 (UTC) Received: (qmail 97069 invoked by uid 500); 8 Jun 2012 21:35:40 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 97016 invoked by uid 500); 8 Jun 2012 21:35:40 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 97008 invoked by uid 99); 8 Jun 2012 21:35:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2012 21:35:40 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jlewis@silverhawk.net designates 209.85.160.45 as permitted sender) Received: from [209.85.160.45] (HELO mail-pb0-f45.google.com) (209.85.160.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jun 2012 21:35:34 +0000 Received: by pbbro12 with SMTP id ro12so3510681pbb.18 for ; Fri, 08 Jun 2012 14:35:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=araOxawwsz00UTQTnICCHFwRlUfvbZwFDbTvzWPBTmU=; b=P8iGpGimarKb3uF1WReD2We3EoATWDbW1AqtmyP4LcafENSFkW+u7rMG0awN0MC22D W62TrtcClNjg1jKCaG8tW3T/ckjAwAjnVdQFJQ9neHVb4Utxu+WNYikRA4GAtYEEdItn cGrGTdTx78EhemEFVTGCsyLHZYguzMdUo9YgG1reJxSHewrNbg2TSQZO62LXr4BeAAmS UOufQG/Tdu+mBrxqSHJEoHWH4KeydQJOLGYN2mR5PvWW8iFKQTm/yrHbQYAKjpzVT0Qe yKlzG4m+drh4ju7pQJMS7k057AflBaCBkENycx0rPUXwx1c0AXC93O1fvRMG+sfp3/yz waEA== Received: by 10.68.220.231 with SMTP id pz7mr23412880pbc.110.1339191313498; Fri, 08 Jun 2012 14:35:13 -0700 (PDT) Received: from cyanide.overstock.com ([65.116.116.6]) by mx.google.com with ESMTPS id vi10sm9076388pbc.4.2012.06.08.14.35.12 (version=SSLv3 cipher=OTHER); Fri, 08 Jun 2012 14:35:13 -0700 (PDT) Sender: Joe Lewis Message-ID: <4FD2703A.8040008@joe-lewis.com> Date: Fri, 08 Jun 2012 15:35:54 -0600 From: Joe Lewis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: modules-dev@httpd.apache.org Subject: Re: Determining mimetype of document References: <4FD26BBF.2030701@joe-lewis.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQk+pYCZndq3xsGy/q25EOSqyoPPkc5Q89mphwBocou0aF5S+Gt729nORuq7/BQRmgljOuv3 X-Virus-Checked: Checked by ClamAV on apache.org On 06/08/2012 03:23 PM, Joshua Marantz wrote: > 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. It shouldn't happen very often at all unless you are using third party modules. > > 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. Unfortunately, I don't. We made the "discovery" when we were setting up a Firefox-vs-Chrome test a few months ago (it was a corporate practical joke), and ended up chalking it up to programmer error. Right now, I'm not even remembering what the exact header when we ran into the problem. Firefox worked, Chrome didn't and we thought it was a problem in Chrome - but ultimately found we were submitting a bad header and Firefox ignored it. When we used the right header, Chrome was working, too. Joe > > -Josh > > 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 >> -- >> http://www.silverhawk.net/ >> Joe -- http://www.silverhawk.net/