Changeset 592


Ignore:
Timestamp:
Jun 7, 2009, 10:47:37 PM (11 years ago)
Author:
julian.reschke@…
Message:

Rephrase "Content-Type" discussion so that it is clear that leaving it out can be better than server-side guessing, and that HTTP itself does not rule out client-side sniffing (related to #155)

Location:
draft-ietf-httpbis/latest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/p3-payload.html

    r588 r592  
    478478         <tr>
    479479            <td class="header left"></td>
    480             <td class="header right">June 1, 2009</td>
     480            <td class="header right">June 8, 2009</td>
    481481         </tr>
    482482      </table>
     
    863863      </p>
    864864      <div id="rfc.figure.u.14"></div><pre class="text">  entity-body := Content-Encoding( Content-Type( data ) )
    865 </pre><p id="rfc.section.3.2.1.p.3">Content-Type specifies the media type of the underlying data. Content-Encoding may be used to indicate any additional content
    866          codings applied to the data, usually for the purpose of data compression, that are a property of the requested resource. There
    867          is no default encoding.
    868       </p>
    869       <p id="rfc.section.3.2.1.p.4">Any HTTP/1.1 message containing an entity-body <em class="bcp14">SHOULD</em> 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
    870          Content-Type field, the recipient <em class="bcp14">MAY</em> attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the
    871          resource. If the media type remains unknown, the recipient <em class="bcp14">SHOULD</em> treat it as type "application/octet-stream" (<a href="#RFC2046" id="rfc.xref.RFC2046.3"><cite title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">[RFC2046]</cite></a>, <a href="http://tools.ietf.org/html/rfc2046#section-4.5.1">Section 4.5.1</a>).
     865</pre><p id="rfc.section.3.2.1.p.3">Content-Type specifies the media type of the underlying data. Any HTTP/1.1 message containing an entity-body <em class="bcp14">SHOULD</em> include a Content-Type header field defining the media type of that body, unless that information is unknown. If the Content-Type
     866         header field is not present, it indicates that the sender does not know the media type of the data; recipients <em class="bcp14">MAY</em> either assume that it is "application/octet-stream" (<a href="#RFC2046" id="rfc.xref.RFC2046.3"><cite title="Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types">[RFC2046]</cite></a>, <a href="http://tools.ietf.org/html/rfc2046#section-4.5.1">Section 4.5.1</a>) or examine the content to determine its type.
     867      </p>
     868      <p id="rfc.section.3.2.1.p.4">Content-Encoding may be used to indicate any additional content codings applied to the data, usually for the purpose of data
     869         compression, that are a property of the requested resource. There is no default encoding.
     870      </p>
     871      <p id="rfc.section.3.2.1.p.5">Note that neither the interpretation of the data type of a message nor the behaviors caused by it are defined by HTTP; this
     872         potentially includes examination of the content to override any indicated type ("sniffing")<span id="rfc.iref.c.2"></span>.
    872873      </p>
    873874      <h3 id="rfc.section.3.2.2"><a href="#rfc.section.3.2.2">3.2.2</a>&nbsp;<a id="entity.length" href="#entity.length">Entity Length</a></h3>
     
    11861187         </p>
    11871188      </div>
    1188       <div id="rfc.iref.c.2"></div>
     1189      <div id="rfc.iref.c.3"></div>
    11891190      <div id="rfc.iref.h.5"></div>
    11901191      <h2 id="rfc.section.5.5"><a href="#rfc.section.5.5">5.5</a>&nbsp;<a id="header.content-encoding" href="#header.content-encoding">Content-Encoding</a></h2>
     
    12091210      <p id="rfc.section.5.5.p.8">If multiple encodings have been applied to an entity, the content codings <em class="bcp14">MUST</em> be listed in the order in which they were applied. Additional information about the encoding parameters <em class="bcp14">MAY</em> be provided by other entity-header fields not defined by this specification.
    12101211      </p>
    1211       <div id="rfc.iref.c.3"></div>
     1212      <div id="rfc.iref.c.4"></div>
    12121213      <div id="rfc.iref.h.6"></div>
    12131214      <h2 id="rfc.section.5.6"><a href="#rfc.section.5.6">5.6</a>&nbsp;<a id="header.content-language" href="#header.content-language">Content-Language</a></h2>
     
    12351236      <p id="rfc.section.5.6.p.9">Content-Language <em class="bcp14">MAY</em> be applied to any media type -- it is not limited to textual documents.
    12361237      </p>
    1237       <div id="rfc.iref.c.4"></div>
     1238      <div id="rfc.iref.c.5"></div>
    12381239      <div id="rfc.iref.h.7"></div>
    12391240      <h2 id="rfc.section.5.7"><a href="#rfc.section.5.7">5.7</a>&nbsp;<a id="header.content-location" href="#header.content-location">Content-Location</a></h2>
     
    12571258      <p id="rfc.section.5.7.p.6">If the Content-Location is a relative URI, the relative URI is interpreted relative to the request-target.</p>
    12581259      <p id="rfc.section.5.7.p.7">The meaning of the Content-Location header in requests is undefined; servers are free to ignore it in those cases.</p>
    1259       <div id="rfc.iref.c.5"></div>
     1260      <div id="rfc.iref.c.6"></div>
    12601261      <div id="rfc.iref.h.8"></div>
    12611262      <h2 id="rfc.section.5.8"><a href="#rfc.section.5.8">5.8</a>&nbsp;<a id="header.content-md5" href="#header.content-md5">Content-MD5</a></h2>
     
    12951296         </p>
    12961297      </div>
    1297       <div id="rfc.iref.c.6"></div>
     1298      <div id="rfc.iref.c.7"></div>
    12981299      <div id="rfc.iref.h.9"></div>
    12991300      <h2 id="rfc.section.5.9"><a href="#rfc.section.5.9">5.9</a>&nbsp;<a id="header.content-type" href="#header.content-type">Content-Type</a></h2>
     
    16811682      </p>
    16821683      <div id="rfc.iref.h.11"></div>
    1683       <div id="rfc.iref.c.7"></div>
     1684      <div id="rfc.iref.c.8"></div>
    16841685      <h2 id="rfc.section.B.1"><a href="#rfc.section.B.1">B.1</a>&nbsp;<a id="content-disposition" href="#content-disposition">Content-Disposition</a></h2>
    16851686      <p id="rfc.section.B.1.p.1">The Content-Disposition response-header field has been proposed as a means for the origin server to suggest a default filename
     
    17191720      <p id="rfc.section.C.1.p.4">A content-coding of "identity" was introduced, to solve problems discovered in caching. (<a href="#content.codings" title="Content Codings">Section&nbsp;2.2</a>)
    17201721      </p>
    1721       <p id="rfc.section.C.1.p.5">The Alternates<span id="rfc.iref.a.5"></span><span id="rfc.iref.h.12"></span>, Content-Version<span id="rfc.iref.c.8"></span><span id="rfc.iref.h.13"></span>, Derived-From<span id="rfc.iref.d.2"></span><span id="rfc.iref.h.14"></span>, Link<span id="rfc.iref.l.1"></span><span id="rfc.iref.h.15"></span>, URI<span id="rfc.iref.u.1"></span><span id="rfc.iref.h.16"></span>, Public<span id="rfc.iref.p.1"></span><span id="rfc.iref.h.17"></span> and Content-Base<span id="rfc.iref.c.9"></span><span id="rfc.iref.h.18"></span> header fields were defined in previous versions of this specification, but not commonly implemented. See <a href="http://tools.ietf.org/html/rfc2068#section-19.6.2">Section 19.6.2</a> of <a href="#RFC2068" id="rfc.xref.RFC2068.5"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2068]</cite></a>.
     1722      <p id="rfc.section.C.1.p.5">The Alternates<span id="rfc.iref.a.5"></span><span id="rfc.iref.h.12"></span>, Content-Version<span id="rfc.iref.c.9"></span><span id="rfc.iref.h.13"></span>, Derived-From<span id="rfc.iref.d.2"></span><span id="rfc.iref.h.14"></span>, Link<span id="rfc.iref.l.1"></span><span id="rfc.iref.h.15"></span>, URI<span id="rfc.iref.u.1"></span><span id="rfc.iref.h.16"></span>, Public<span id="rfc.iref.p.1"></span><span id="rfc.iref.h.17"></span> and Content-Base<span id="rfc.iref.c.10"></span><span id="rfc.iref.h.18"></span> header fields were defined in previous versions of this specification, but not commonly implemented. See <a href="http://tools.ietf.org/html/rfc2068#section-19.6.2">Section 19.6.2</a> of <a href="#RFC2068" id="rfc.xref.RFC2068.5"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2068]</cite></a>.
    17221723      </p>
    17231724      <h2 id="rfc.section.C.2"><a href="#rfc.section.C.2">C.2</a>&nbsp;<a id="changes.from.rfc.2616" href="#changes.from.rfc.2616">Changes from RFC 2616</a></h2>
     
    19261927      <ul>
    19271928         <li> &lt;<a href="http://tools.ietf.org/wg/httpbis/trac/ticket/80">http://tools.ietf.org/wg/httpbis/trac/ticket/80</a>&gt;: "Content-Location isn't special"
     1929         </li>
     1930         <li> &lt;<a href="http://tools.ietf.org/wg/httpbis/trac/ticket/155">http://tools.ietf.org/wg/httpbis/trac/ticket/155</a>&gt;: "Content Sniffing"
    19281931         </li>
    19291932      </ul>
     
    19471950            <li class="indline0"><a id="rfc.index.C" href="#rfc.index.C"><b>C</b></a><ul class="ind">
    19481951                  <li class="indline1">compress&nbsp;&nbsp;<a class="iref" href="#rfc.iref.c.1">2.2</a></li>
    1949                   <li class="indline1">Content-Base header&nbsp;&nbsp;<a class="iref" href="#rfc.iref.c.9"><b>C.1</b></a></li>
    1950                   <li class="indline1">Content-Disposition header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.content-disposition.1">6.1</a>, <a class="iref" href="#rfc.xref.content-disposition.2">7.2</a>, <a class="iref" href="#rfc.iref.c.7"><b>B.1</b></a>, <a class="iref" href="#rfc.extref.c.32">B.1</a>, <a class="iref" href="#rfc.extref.c.50">D</a></li>
    1951                   <li class="indline1">Content-Encoding header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.header.content-encoding.1">2.2</a>, <a class="iref" href="#rfc.xref.header.content-encoding.2">3.1</a>, <a class="iref" href="#rfc.iref.c.2"><b>5.5</b></a>, <a class="iref" href="#rfc.xref.header.content-encoding.3">5.5</a>, <a class="iref" href="#rfc.xref.header.content-encoding.4">6.1</a></li>
    1952                   <li class="indline1">Content-Language header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.header.content-language.1">3.1</a>, <a class="iref" href="#rfc.iref.c.3"><b>5.6</b></a>, <a class="iref" href="#rfc.xref.header.content-language.2">6.1</a></li>
    1953                   <li class="indline1">Content-Location header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.header.content-location.1">3.1</a>, <a class="iref" href="#rfc.iref.c.4"><b>5.7</b></a>, <a class="iref" href="#rfc.xref.header.content-location.2">6.1</a></li>
    1954                   <li class="indline1">Content-MD5 header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.header.content-md5.1">3.1</a>, <a class="iref" href="#rfc.iref.c.5"><b>5.8</b></a>, <a class="iref" href="#rfc.xref.header.content-md5.2">6.1</a></li>
    1955                   <li class="indline1">Content-Type header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.header.content-type.1">2.3</a>, <a class="iref" href="#rfc.xref.header.content-type.2">3.1</a>, <a class="iref" href="#rfc.iref.c.6"><b>5.9</b></a>, <a class="iref" href="#rfc.xref.header.content-type.3">6.1</a></li>
    1956                   <li class="indline1">Content-Version header&nbsp;&nbsp;<a class="iref" href="#rfc.iref.c.8"><b>C.1</b></a></li>
     1952                  <li class="indline1">Content Type Sniffing&nbsp;&nbsp;<a class="iref" href="#rfc.iref.c.2">3.2.1</a></li>
     1953                  <li class="indline1">Content-Base header&nbsp;&nbsp;<a class="iref" href="#rfc.iref.c.10"><b>C.1</b></a></li>
     1954                  <li class="indline1">Content-Disposition header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.content-disposition.1">6.1</a>, <a class="iref" href="#rfc.xref.content-disposition.2">7.2</a>, <a class="iref" href="#rfc.iref.c.8"><b>B.1</b></a>, <a class="iref" href="#rfc.extref.c.32">B.1</a>, <a class="iref" href="#rfc.extref.c.50">D</a></li>
     1955                  <li class="indline1">Content-Encoding header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.header.content-encoding.1">2.2</a>, <a class="iref" href="#rfc.xref.header.content-encoding.2">3.1</a>, <a class="iref" href="#rfc.iref.c.3"><b>5.5</b></a>, <a class="iref" href="#rfc.xref.header.content-encoding.3">5.5</a>, <a class="iref" href="#rfc.xref.header.content-encoding.4">6.1</a></li>
     1956                  <li class="indline1">Content-Language header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.header.content-language.1">3.1</a>, <a class="iref" href="#rfc.iref.c.4"><b>5.6</b></a>, <a class="iref" href="#rfc.xref.header.content-language.2">6.1</a></li>
     1957                  <li class="indline1">Content-Location header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.header.content-location.1">3.1</a>, <a class="iref" href="#rfc.iref.c.5"><b>5.7</b></a>, <a class="iref" href="#rfc.xref.header.content-location.2">6.1</a></li>
     1958                  <li class="indline1">Content-MD5 header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.header.content-md5.1">3.1</a>, <a class="iref" href="#rfc.iref.c.6"><b>5.8</b></a>, <a class="iref" href="#rfc.xref.header.content-md5.2">6.1</a></li>
     1959                  <li class="indline1">Content-Type header&nbsp;&nbsp;<a class="iref" href="#rfc.xref.header.content-type.1">2.3</a>, <a class="iref" href="#rfc.xref.header.content-type.2">3.1</a>, <a class="iref" href="#rfc.iref.c.7"><b>5.9</b></a>, <a class="iref" href="#rfc.xref.header.content-type.3">6.1</a></li>
     1960                  <li class="indline1">Content-Version header&nbsp;&nbsp;<a class="iref" href="#rfc.iref.c.9"><b>C.1</b></a></li>
    19571961               </ul>
    19581962            </li>
  • draft-ietf-httpbis/latest/p3-payload.xml

    r588 r592  
    722722</artwork></figure>
    723723<t>
    724    Content-Type specifies the media type of the underlying data.
     724   Content-Type specifies the media type of the underlying data. Any HTTP/1.1
     725   message containing an entity-body &SHOULD; include a Content-Type header
     726   field defining the media type of that body, unless that information is
     727   unknown.  If the Content-Type header field is not present, it indicates that
     728   the sender does not know the media type of the data; recipients &MAY;
     729   either assume that it is "application/octet-stream" (<xref target="RFC2046" x:fmt="," x:sec="4.5.1"/>)
     730   or examine the content to determine its type.
     731</t>
     732<t>
    725733   Content-Encoding may be used to indicate any additional content
    726734   codings applied to the data, usually for the purpose of data
    727    compression, that are a property of the requested resource. There is
     735   compression, that are a property of the requested resource.  There is
    728736   no default encoding.
    729737</t>
    730738<t>
    731    Any HTTP/1.1 message containing an entity-body &SHOULD; include a
    732    Content-Type header field defining the media type of that body. If
    733    and only if the media type is not given by a Content-Type field, the
    734    recipient &MAY; attempt to guess the media type via inspection of its
    735    content and/or the name extension(s) of the URI used to identify the
    736    resource. If the media type remains unknown, the recipient &SHOULD;
    737    treat it as type "application/octet-stream" (<xref target="RFC2046" x:fmt="," x:sec="4.5.1"/>).
     739   Note that neither the interpretation of the data type of a message nor
     740   the behaviors caused by it are defined by HTTP; this
     741   potentially includes examination of the content to override any
     742   indicated type ("sniffing")<iref item="Content Type Sniffing"/>.
    738743</t>
    739744</section>
     
    29602965      "Content-Location isn't special"
    29612966    </t>
     2967    <t>
     2968      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/155"/>:
     2969      "Content Sniffing"
     2970    </t>
    29622971  </list>
    29632972</t>
Note: See TracChangeset for help on using the changeset viewer.