Ignore:
Timestamp:
Nov 12, 2008, 5:33:44 PM (11 years ago)
Author:
julian.reschke@…
Message:

Rewrite header ABNFs to spell out whitespace rules, factor out value format definitions. (related to #36)

File:
1 edited

Legend:

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

    r345 r357  
    257257  <x:anchor-alias value="quoted-string"/>
    258258  <x:anchor-alias value="token"/>
     259  <x:anchor-alias value="BWS"/>
     260  <x:anchor-alias value="OWS"/>
     261  <x:anchor-alias value="RWS"/>
    259262<t>
    260263  This specification uses the ABNF syntax defined in &notation-abnf; and
     
    271274  <x:ref>quoted-string</x:ref>  = &lt;quoted-string, defined in &basic-rules;&gt;
    272275  <x:ref>token</x:ref>          = &lt;token, defined in &basic-rules;&gt;
     276  <x:ref>BWS</x:ref>            = &lt;BWS, defined in &basic-rules;&gt;
     277  <x:ref>OWS</x:ref>            = &lt;OWS, defined in &basic-rules;&gt;
     278  <x:ref>RWS</x:ref>            = &lt;RWS, defined in &basic-rules;&gt;
    273279</artwork></figure>
    274280<t anchor="abnf.dependencies">
     
    462468</t>
    463469<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="media-type"/><iref primary="true" item="Grammar" subitem="type"/><iref primary="true" item="Grammar" subitem="subtype"/>
    464   <x:ref>media-type</x:ref>     = <x:ref>type</x:ref> "/" <x:ref>subtype</x:ref> *( ";" <x:ref>parameter</x:ref> )
    465   <x:ref>type</x:ref>           = <x:ref>token</x:ref>
    466   <x:ref>subtype</x:ref>        = <x:ref>token</x:ref>
     470  <x:ref>media-type</x:ref> = <x:ref>type</x:ref> "/" <x:ref>subtype</x:ref> *( <x:ref>OWS</x:ref> ";" <x:ref>OWS</x:ref> <x:ref>parameter</x:ref> )
     471  <x:ref>type</x:ref>       = <x:ref>token</x:ref>
     472  <x:ref>subtype</x:ref>    = <x:ref>token</x:ref>
    467473</artwork></figure>
    468474<t anchor="rule.parameter">
     
    914920  <iref primary="true" item="Headers" subitem="Accept" x:for-anchor=""/>
    915921  <x:anchor-alias value="Accept"/>
     922  <x:anchor-alias value="Accept-v"/>
    916923  <x:anchor-alias value="accept-extension"/>
    917924  <x:anchor-alias value="accept-params"/>
    918925  <x:anchor-alias value="media-range"/>
    919926<t>
    920    The Accept request-header field can be used to specify certain media
     927   The request-header field "Accept" can be used to specify certain media
    921928   types which are acceptable for the response. Accept headers can be
    922929   used to indicate that the request is specifically limited to a small
     
    924931   image.
    925932</t>
    926 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept"/><iref primary="true" item="Grammar" subitem="media-range"/><iref primary="true" item="Grammar" subitem="accept-params"/><iref primary="true" item="Grammar" subitem="accept-extension"/>
    927   <x:ref>Accept</x:ref>         = "Accept" ":"
    928                   #( <x:ref>media-range</x:ref> [ <x:ref>accept-params</x:ref> ] )
     933<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept"/><iref primary="true" item="Grammar" subitem="Accept-v"/><iref primary="true" item="Grammar" subitem="media-range"/><iref primary="true" item="Grammar" subitem="accept-params"/><iref primary="true" item="Grammar" subitem="accept-extension"/>
     934  <x:ref>Accept</x:ref>   = "Accept" BWS ":" OWS <x:ref>Accept-v</x:ref>
     935  <x:ref>Accept-v</x:ref> = #( <x:ref>media-range</x:ref> [ <x:ref>accept-params</x:ref> ] )
    929936 
    930937  <x:ref>media-range</x:ref>    = ( "*/*"
     
    964971</t>
    965972<figure><artwork type="example">
    966     Accept: audio/*; q=0.2, audio/basic
     973  Accept: audio/*; q=0.2, audio/basic
    967974</artwork></figure>
    968975<t>
     
    981988</t>
    982989<figure><artwork type="example">
    983     Accept: text/plain; q=0.5, text/html,
    984             text/x-dvi; q=0.8, text/x-c
     990  Accept: text/plain; q=0.5, text/html,
     991          text/x-dvi; q=0.8, text/x-c
    985992</artwork></figure>
    986993<t>
     
    9961003</t>
    9971004<figure><artwork type="example">
    998     Accept: text/*, text/html, text/html;level=1, */*
     1005  Accept: text/*, text/html, text/html;level=1, */*
    9991006</artwork></figure>
    10001007<t>
     
    10131020</t>
    10141021<figure><artwork type="example">
    1015     Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,
    1016             text/html;level=2;q=0.4, */*;q=0.5
     1022  Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,
     1023          text/html;level=2;q=0.4, */*;q=0.5
    10171024</artwork></figure>
    10181025<t>
     
    10391046  <iref primary="true" item="Headers" subitem="Accept-Charset" x:for-anchor=""/>
    10401047  <x:anchor-alias value="Accept-Charset"/>
    1041 <t>
    1042    The Accept-Charset request-header field can be used to indicate what
     1048  <x:anchor-alias value="Accept-Charset-v"/>
     1049<t>
     1050   The request-header field "Accept-Charset" can be used to indicate what
    10431051   character sets are acceptable for the response. This field allows
    10441052   clients capable of understanding more comprehensive or special-purpose
     
    10461054   capable of representing documents in those character sets.
    10471055</t>
    1048 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Charset"/>
    1049   <x:ref>Accept-Charset</x:ref> = "Accept-Charset" ":"
    1050           1#( ( <x:ref>charset</x:ref> / "*" ) [ ";" "q" "=" <x:ref>qvalue</x:ref> ] )
     1056<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Charset"/><iref primary="true" item="Grammar" subitem="Accept-Charset-v"/>
     1057  <x:ref>Accept-Charset</x:ref>   = "Accept-Charset" BWS ":" OWS
     1058          <x:ref>Accept-Charset-v</x:ref>
     1059  <x:ref>Accept-Charset-v</x:ref> = 1#( ( <x:ref>charset</x:ref> / "*" ) [ ";" "q" "=" <x:ref>qvalue</x:ref> ] )
    10511060</artwork></figure>
    10521061<t>
     
    10561065</t>
    10571066<figure><artwork type="example">
    1058    Accept-Charset: iso-8859-5, unicode-1-1;q=0.8
     1067  Accept-Charset: iso-8859-5, unicode-1-1;q=0.8
    10591068</artwork></figure>
    10601069<t>
     
    10801089  <iref primary="true" item="Headers" subitem="Accept-Encoding" x:for-anchor=""/>
    10811090  <x:anchor-alias value="Accept-Encoding"/>
     1091  <x:anchor-alias value="Accept-Encoding-v"/>
    10821092  <x:anchor-alias value="codings"/>
    10831093<t>
    1084    The Accept-Encoding request-header field is similar to Accept, but
     1094   The request-header field "Accept-Encoding" is similar to Accept, but
    10851095   restricts the content-codings (<xref target="content.codings"/>) that are acceptable in
    10861096   the response.
    10871097</t>
    1088 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Encoding"/><iref primary="true" item="Grammar" subitem="codings"/>
    1089   <x:ref>Accept-Encoding</x:ref>  = "Accept-Encoding" ":"
     1098<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Encoding"/><iref primary="true" item="Grammar" subitem="Accept-Encoding-v"/><iref primary="true" item="Grammar" subitem="codings"/>
     1099  <x:ref>Accept-Encoding</x:ref>    = "Accept-Encoding" BWS ":" OWS
     1100                     <x:ref>Accept-Encoding-v</x:ref>
     1101  <x:ref>Accept-Encoding-v</x:ref>  =
    10901102                     #( <x:ref>codings</x:ref> [ ";" "q" "=" <x:ref>qvalue</x:ref> ] )
    1091   <x:ref>codings</x:ref>          = ( <x:ref>content-coding</x:ref> / "*" )
     1103  <x:ref>codings</x:ref>            = ( <x:ref>content-coding</x:ref> / "*" )
    10921104</artwork></figure>
    10931105<t>
     
    10991111</t>
    11001112<figure><artwork type="example">
    1101     Accept-Encoding: compress, gzip
    1102     Accept-Encoding:
    1103     Accept-Encoding: *
    1104     Accept-Encoding: compress;q=0.5, gzip;q=1.0
    1105     Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0
     1113  Accept-Encoding: compress, gzip
     1114  Accept-Encoding:
     1115  Accept-Encoding: *
     1116  Accept-Encoding: compress;q=0.5, gzip;q=1.0
     1117  Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0
    11061118</artwork></figure>
    11071119<t>
     
    11621174  <iref primary="true" item="Headers" subitem="Accept-Language" x:for-anchor=""/>
    11631175  <x:anchor-alias value="Accept-Language"/>
     1176  <x:anchor-alias value="Accept-Language-v"/>
    11641177  <x:anchor-alias value="language-range"/>
    11651178<t>
    1166    The Accept-Language request-header field is similar to Accept, but
     1179   The request-header field "Accept-Language" is similar to Accept, but
    11671180   restricts the set of natural languages that are preferred as a
    11681181   response to the request. Language tags are defined in <xref target="language.tags"/>.
    11691182</t>
    1170 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Language"/><iref primary="true" item="Grammar" subitem="language-range"/>
    1171   <x:ref>Accept-Language</x:ref> = "Accept-Language" ":"
     1183<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Accept-Language"/><iref primary="true" item="Grammar" subitem="Accept-Language-v"/><iref primary="true" item="Grammar" subitem="language-range"/>
     1184  <x:ref>Accept-Language</x:ref>   = "Accept-Language" BWS ":" OWS
     1185                    <x:ref>Accept-Language-v</x:ref>
     1186  <x:ref>Accept-Language-v</x:ref> =
    11721187                    1#( <x:ref>language-range</x:ref> [ ";" "q" "=" <x:ref>qvalue</x:ref> ] )
    1173   <x:ref>language-range</x:ref>  =
     1188  <x:ref>language-range</x:ref>    =
    11741189            &lt;language-range, defined in <xref target="RFC4647" x:fmt="," x:sec="2.1"/>&gt;
    11751190</artwork></figure>
     
    11811196</t>
    11821197<figure><artwork type="example">
    1183     Accept-Language: da, en-gb;q=0.8, en;q=0.7
     1198  Accept-Language: da, en-gb;q=0.8, en;q=0.7
    11841199</artwork></figure>
    11851200<t>
     
    12521267  <iref primary="true" item="Headers" subitem="Content-Encoding" x:for-anchor=""/>
    12531268  <x:anchor-alias value="Content-Encoding"/>
    1254 <t>
    1255    The Content-Encoding entity-header field is used as a modifier to the
     1269  <x:anchor-alias value="Content-Encoding-v"/>
     1270<t>
     1271   The entity-header field "Content-Encoding" is used as a modifier to the
    12561272   media-type. When present, its value indicates what additional content
    12571273   codings have been applied to the entity-body, and thus what decoding
     
    12611277   the identity of its underlying media type.
    12621278</t>
    1263 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Encoding"/>
    1264   <x:ref>Content-Encoding</x:ref>  = "Content-Encoding" ":" 1#<x:ref>content-coding</x:ref>
     1279<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Encoding"/><iref primary="true" item="Grammar" subitem="Content-Encoding-v"/>
     1280  <x:ref>Content-Encoding</x:ref>   = "Content-Encoding" BWS ":" OWS <x:ref>Content-Encoding-v</x:ref>
     1281  <x:ref>Content-Encoding-v</x:ref> = 1#<x:ref>content-coding</x:ref>
    12651282</artwork></figure>
    12661283<t>
     
    12681285</t>
    12691286<figure><artwork type="example">
    1270     Content-Encoding: gzip
     1287  Content-Encoding: gzip
    12711288</artwork></figure>
    12721289<t>
     
    13001317  <iref primary="true" item="Headers" subitem="Content-Language" x:for-anchor=""/>
    13011318  <x:anchor-alias value="Content-Language"/>
    1302 <t>
    1303    The Content-Language entity-header field describes the natural
     1319  <x:anchor-alias value="Content-Language-v"/>
     1320<t>
     1321   The entity-header field "Content-Language" describes the natural
    13041322   language(s) of the intended audience for the enclosed entity. Note
    13051323   that this might not be equivalent to all the languages used within
    13061324   the entity-body.
    13071325</t>
    1308 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Language"/>
    1309   <x:ref>Content-Language</x:ref>  = "Content-Language" ":" 1#<x:ref>language-tag</x:ref>
     1326<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Language"/><iref primary="true" item="Grammar" subitem="Content-Language-v"/>
     1327  <x:ref>Content-Language</x:ref>   = "Content-Language" BWS ":" OWS <x:ref>Content-Language-v</x:ref>
     1328  <x:ref>Content-Language-v</x:ref> = 1#<x:ref>language-tag</x:ref>
    13101329</artwork></figure>
    13111330<t>
     
    13171336</t>
    13181337<figure><artwork type="example">
    1319     Content-Language: da
     1338  Content-Language: da
    13201339</artwork></figure>
    13211340<t>
     
    13321351</t>
    13331352<figure><artwork type="example">
    1334     Content-Language: mi, en
     1353  Content-Language: mi, en
    13351354</artwork></figure>
    13361355<t>
     
    13521371  <iref primary="true" item="Headers" subitem="Content-Location" x:for-anchor=""/>
    13531372  <x:anchor-alias value="Content-Location"/>
    1354 <t>
    1355    The Content-Location entity-header field &MAY; be used to supply the
     1373  <x:anchor-alias value="Content-Location-v"/>
     1374<t>
     1375   The entity-header field "Content-Location" &MAY; be used to supply the
    13561376   resource location for the entity enclosed in the message when that
    13571377   entity is accessible from a location separate from the requested
     
    13631383   for the particular variant which is returned.
    13641384</t>
    1365 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Location"/>
    1366   <x:ref>Content-Location</x:ref> = "Content-Location" ":"
    1367                     ( <x:ref>absoluteURI</x:ref> / <x:ref>relativeURI</x:ref> )
     1385<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Location"/><iref primary="true" item="Grammar" subitem="Content-Location-v"/>
     1386  <x:ref>Content-Location</x:ref>   = "Content-Location" BWS ":" OWS
     1387                    <x:ref>Content-Location-v</x:ref>
     1388  <x:ref>Content-Location-v</x:ref> =
     1389                    <x:ref>absoluteURI</x:ref> / <x:ref>relativeURI</x:ref>
    13681390</artwork></figure>
    13691391<t>
     
    14001422  <iref primary="true" item="Headers" subitem="Content-MD5" x:for-anchor=""/>
    14011423  <x:anchor-alias value="Content-MD5"/>
    1402   <x:anchor-alias value="md5-digest"/>
    1403 <t>
    1404    The Content-MD5 entity-header field, as defined in <xref target="RFC1864"/>, is
     1424  <x:anchor-alias value="Content-MD5-v"/>
     1425<t>
     1426   The entity-header field "Content-MD5", as defined in <xref target="RFC1864"/>, is
    14051427   an MD5 digest of the entity-body for the purpose of providing an
    14061428   end-to-end message integrity check (MIC) of the entity-body. (Note: a
     
    14081430   in transit, but is not proof against malicious attacks.)
    14091431</t>
    1410 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-MD5"/><iref primary="true" item="Grammar" subitem="md5-digest"/>
    1411   <x:ref>Content-MD5</x:ref>   = "Content-MD5" ":" <x:ref>md5-digest</x:ref>
    1412   <x:ref>md5-digest</x:ref>    = &lt;base64 of 128 bit MD5 digest as per <xref target="RFC1864"/>&gt;
     1432<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-MD5"/><iref primary="true" item="Grammar" subitem="Content-MD5-v"/>
     1433  <x:ref>Content-MD5</x:ref>   = "Content-MD5" BWS ":" OWS <x:ref>Content-MD5-v</x:ref>
     1434  <x:ref>Content-MD5-v</x:ref> = &lt;base64 of 128 bit MD5 digest as per <xref target="RFC1864"/>&gt;
    14131435</artwork></figure>
    14141436<t>
     
    14751497  <iref primary="true" item="Headers" subitem="Content-Type" x:for-anchor=""/>
    14761498  <x:anchor-alias value="Content-Type"/>
    1477 <t>
    1478    The Content-Type entity-header field indicates the media type of the
     1499  <x:anchor-alias value="Content-Type-v"/>
     1500<t>
     1501   The entity-header field "Content-Type" indicates the media type of the
    14791502   entity-body sent to the recipient or, in the case of the HEAD method,
    14801503   the media type that would have been sent had the request been a GET.
    14811504</t>
    1482 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Type"/>
    1483   <x:ref>Content-Type</x:ref>   = "Content-Type" ":" <x:ref>media-type</x:ref>
     1505<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Type"/><iref primary="true" item="Grammar" subitem="Content-Type-v"/>
     1506  <x:ref>Content-Type</x:ref>   = "Content-Type" BWS ":" OWS <x:ref>Content-Type-v</x:ref>
     1507  <x:ref>Content-Type-v</x:ref> = <x:ref>media-type</x:ref>
    14841508</artwork></figure>
    14851509<t>
     
    14871511</t>
    14881512<figure><artwork type="example">
    1489     Content-Type: text/html; charset=ISO-8859-4
     1513  Content-Type: text/html; charset=ISO-8859-4
    14901514</artwork></figure>
    14911515<t>
     
    23562380  <iref primary="true" item="Headers" subitem="MIME-Version" x:for-anchor=""/>
    23572381  <x:anchor-alias value="MIME-Version"/>
     2382  <x:anchor-alias value="MIME-Version-v"/>
    23582383<t>
    23592384   HTTP is not a MIME-compliant protocol. However, HTTP/1.1 messages &MAY;
     
    23652390   possible) when exporting HTTP messages to strict MIME environments.
    23662391</t>
    2367 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="MIME-Version"/>
    2368   <x:ref>MIME-Version</x:ref>   = "MIME-Version" ":" 1*<x:ref>DIGIT</x:ref> "." 1*<x:ref>DIGIT</x:ref>
     2392<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="MIME-Version"/><iref primary="true" item="Grammar" subitem="MIME-Version-v"/>
     2393  <x:ref>MIME-Version</x:ref>   = "MIME-Version" BWS ":" OWS <x:ref>MIME-Version-v</x:ref>
     2394  <x:ref>MIME-Version-v</x:ref> = 1*<x:ref>DIGIT</x:ref> "." 1*<x:ref>DIGIT</x:ref>
    23692395</artwork></figure>
    23702396<t>
     
    24792505<iref item="Content-Disposition header" primary="true" x:for-anchor=""/>
    24802506  <x:anchor-alias value="content-disposition"/>
     2507  <x:anchor-alias value="content-disposition-v"/>
    24812508  <x:anchor-alias value="disposition-type"/>
    24822509  <x:anchor-alias value="disposition-parm"/>
     
    24902517   from the definition of Content-Disposition in <xref target="RFC2183"/>.
    24912518</t>
    2492 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="content-disposition"/><iref primary="true" item="Grammar" subitem="disposition-type"/><iref primary="true" item="Grammar" subitem="disposition-parm"/><iref primary="true" item="Grammar" subitem="filename-parm"/><iref primary="true" item="Grammar" subitem="disp-extension-token"/><iref primary="true" item="Grammar" subitem="disp-extension-parm"/>
    2493   <x:ref>content-disposition</x:ref> = "Content-Disposition" ":"
    2494                         <x:ref>disposition-type</x:ref> *( ";" <x:ref>disposition-parm</x:ref> )
     2519<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="content-disposition"/><iref primary="true" item="Grammar" subitem="content-disposition-v"/><iref primary="true" item="Grammar" subitem="disposition-type"/><iref primary="true" item="Grammar" subitem="disposition-parm"/><iref primary="true" item="Grammar" subitem="filename-parm"/><iref primary="true" item="Grammar" subitem="disp-extension-token"/><iref primary="true" item="Grammar" subitem="disp-extension-parm"/>
     2520  <x:ref>content-disposition</x:ref> = "Content-Disposition" BWS ":" OWS
     2521                        <x:ref>content-disposition-v</x:ref>
     2522  <x:ref>content-disposition-v</x:ref> = <x:ref>disposition-type</x:ref> *( ";" <x:ref>disposition-parm</x:ref> )
    24952523  <x:ref>disposition-type</x:ref> = "attachment" / <x:ref>disp-extension-token</x:ref>
    24962524  <x:ref>disposition-parm</x:ref> = <x:ref>filename-parm</x:ref> / <x:ref>disp-extension-parm</x:ref>
     
    25032531</t>
    25042532<figure><artwork type="example">
    2505      Content-Disposition: attachment; filename="fname.ext"
     2533   Content-Disposition: attachment; filename="fname.ext"
    25062534</artwork></figure>
    25072535<t>
     
    27202748      Use "/" instead of "|" for alternatives.
    27212749    </t>
     2750    <t>
     2751      Introduce new ABNF rules for "bad" whitespace ("BWS"), optional
     2752      whitespace ("OWS") and required whitespace ("RWS").
     2753    </t>
     2754    <t>
     2755      Rewrite ABNFs to spell out whitespace rules, factor out
     2756      header value format definitions.
     2757    </t>
    27222758  </list>
    27232759</t>
Note: See TracChangeset for help on using the changeset viewer.