Subject: Re: PROPOSAL: content sniffing [#155]

From: =JeffH <[email-masked]>
Date: Wed, 08 Apr 2009 13:47:52 -0700

> It seems like Mark's proposal is the minimum required to declare
 > victory, from an HTTP standpoint at least.
 >
 > Remove this text from p3 section 3.2.1:
 >> "If and only if the media type is not given by a Content-Type field,
 >> the recipient MAY attempt to guess the media type via inspection of
 >> its content and/or the name extension(s) of the URI used to identify
 >> the resource."

Nominally agreed.

The entire present paragraph from p3 section 3.2.1 reads..

    Any HTTP/1.1 message containing an entity-body SHOULD include a
    Content-Type header field defining the media type of that body.  If
    and only if the media type is not given by a Content-Type field, the
    recipient MAY attempt to guess the media type via inspection of its
    content and/or the name extension(s) of the URI used to identify the
    resource.  If the media type remains unknown, the recipient SHOULD
    treat it as type "application/octet-stream".

If the second sentence is simply deleted it will read..

    Any HTTP/1.1 message containing an entity-body SHOULD include a
    Content-Type header field defining the media type of that body.
    If the media type remains unknown, the recipient SHOULD
    treat it as type "application/octet-stream".

..which seems sub-optimal wrt the "remains unknown" phrase.

We should probably alter the last sentence in the para such that the para reads 
e.g...

    Any HTTP/1.1 message containing an entity-body SHOULD include a
    Content-Type header field defining the media type of that body.
    If a Content-Type header field is not present, the recipient SHOULD
    treat the entity-body as type "application/octet-stream".

Further subtle refinements worth considering are..

   s/defining/declaring/

   s/treat/regard/

..yielding..

    Any HTTP/1.1 message containing an entity-body SHOULD include a
    Content-Type header field declaring the media type of that body.
    If a Content-Type header field is not present, the recipient SHOULD
    regard the entity-body as type "application/octet-stream".

HTH,

=JeffH

---

From: =JeffH <[email-masked]>
Date: Wed, 08 Apr 2009 14:34:01 -0700

Julian Reschke wrote:
 > First of all, we're only discussing Content-Type, *not* Content-Encoding
 > right?
 >
 > That being said, in the spirit of defining the meaning of the message,
 > not it's processing, how about:
 >
 > "When an entity-body is included with a message, the data type of that
 > body is declared using the header fields Content-Type and Content-Encoding."

+1

=JeffH

---

From: =JeffH <[email-masked]>
Date: Thu, 09 Apr 2009 10:32:31 -0700

> Note that by removing the second sentence from the last paragraph, we
 > now have a dangling "...if remains unknown...".

Yes, the same thing (and a bit more) was noted in an earlier message..

http://lists.w3.org/Archives/Public/ietf-http-wg/2009AprJun/0164.html

=JeffH