Ignore:
Timestamp:
Nov 12, 2008, 4:36:25 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/p2-semantics.xml

    r345 r356  
    294294  <x:anchor-alias value="quoted-string"/>
    295295  <x:anchor-alias value="token"/>
     296  <x:anchor-alias value="BWS"/>
     297  <x:anchor-alias value="OWS"/>
     298  <x:anchor-alias value="RWS"/>
    296299<t>
    297300  This specification uses the ABNF syntax defined in &notation-abnf; and
     
    307310  <x:ref>quoted-string</x:ref> = &lt;quoted-string, defined in &basic-rules;&gt;
    308311  <x:ref>token</x:ref>         = &lt;token, defined in &basic-rules;&gt;
     312  <x:ref>BWS</x:ref>           = &lt;BWS, defined in &basic-rules;&gt;
     313  <x:ref>OWS</x:ref>           = &lt;OWS, defined in &basic-rules;&gt;
     314  <x:ref>RWS</x:ref>           = &lt;RWS, defined in &basic-rules;&gt;
    309315</artwork></figure>
    310316<t anchor="abnf.dependencies">
     
    17941800  <iref primary="true" item="Headers" subitem="Allow" x:for-anchor=""/>
    17951801  <x:anchor-alias value="Allow"/>
    1796 <t>
    1797       The Allow response-header field lists the set of methods advertised as
     1802  <x:anchor-alias value="Allow-v"/>
     1803<t>
     1804      The response-header field "Allow" lists the set of methods advertised as
    17981805      supported by the resource identified by the Request-URI. The purpose of
    17991806      this field is strictly to inform the recipient of valid methods
     
    18011808      present in a 405 (Method Not Allowed) response.
    18021809</t>
    1803 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Allow"/>
    1804   <x:ref>Allow</x:ref>   = "Allow" ":" #<x:ref>Method</x:ref>
     1810<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Allow"/><iref primary="true" item="Grammar" subitem="Allow-v"/>
     1811  <x:ref>Allow</x:ref>   = "Allow" <x:ref>BWS</x:ref> ":" <x:ref>OWS</x:ref> <x:ref>Allow-v</x:ref>
     1812  <x:ref>Allow-v</x:ref> = #<x:ref>Method</x:ref>
    18051813</artwork></figure>
    18061814<t>
     
    18081816</t>
    18091817<figure><artwork type="example">
    1810        Allow: GET, HEAD, PUT
     1818  Allow: GET, HEAD, PUT
    18111819</artwork></figure>
    18121820<t>
     
    18251833  <iref primary="true" item="Headers" subitem="Expect" x:for-anchor=""/>
    18261834  <x:anchor-alias value="Expect"/>
     1835  <x:anchor-alias value="Expect-v"/>
    18271836  <x:anchor-alias value="expectation"/>
    18281837  <x:anchor-alias value="expectation-extension"/>
    18291838  <x:anchor-alias value="expect-params"/>
    18301839<t>
    1831    The Expect request-header field is used to indicate that particular
     1840   The request-header field "Expect" is used to indicate that particular
    18321841   server behaviors are required by the client.
    18331842</t>
    1834 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Expect"/><iref primary="true" item="Grammar" subitem="expectation"/><iref primary="true" item="Grammar" subitem="expectation-extension"/><iref primary="true" item="Grammar" subitem="expect-params"/>
    1835   <x:ref>Expect</x:ref>       =  "Expect" ":" 1#<x:ref>expectation</x:ref>
     1843<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Expect"/><iref primary="true" item="Grammar" subitem="Expect-v"/><iref primary="true" item="Grammar" subitem="expectation"/><iref primary="true" item="Grammar" subitem="expectation-extension"/><iref primary="true" item="Grammar" subitem="expect-params"/>
     1844  <x:ref>Expect</x:ref>       = "Expect" <x:ref>BWS</x:ref> ":" <x:ref>OWS</x:ref> <x:ref>Expect-v</x:ref>
     1845  <x:ref>Expect-v</x:ref>     = 1#<x:ref>expectation</x:ref>
    18361846 
    1837   <x:ref>expectation</x:ref>  =  "100-continue" / <x:ref>expectation-extension</x:ref>
    1838   <x:ref>expectation-extension</x:ref> =  <x:ref>token</x:ref> [ "=" ( <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref> )
     1847  <x:ref>expectation</x:ref>  = "100-continue" / <x:ref>expectation-extension</x:ref>
     1848  <x:ref>expectation-extension</x:ref> = <x:ref>token</x:ref> [ "=" ( <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref> )
    18391849                           *<x:ref>expect-params</x:ref> ]
    1840   <x:ref>expect-params</x:ref> =  ";" <x:ref>token</x:ref> [ "=" ( <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref> ) ]
     1850  <x:ref>expect-params</x:ref> = ";" <x:ref>token</x:ref> [ "=" ( <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref> ) ]
    18411851</artwork></figure>
    18421852<t>
     
    18791889  <iref primary="true" item="Headers" subitem="From" x:for-anchor=""/>
    18801890  <x:anchor-alias value="From"/>
     1891  <x:anchor-alias value="From-v"/>
    18811892  <x:anchor-alias value="mailbox"/>
    18821893<t>
    1883    The From request-header field, if given, &SHOULD; contain an Internet
     1894   The request-header field "From", if given, &SHOULD; contain an Internet
    18841895   e-mail address for the human user who controls the requesting user
    18851896   agent. The address &SHOULD; be machine-usable, as defined by "mailbox"
    18861897   in <xref x:sec="3.4" x:fmt="of" target="RFC5322"/>:
    18871898</t>
    1888 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="From"/>
    1889   <x:ref>From</x:ref>    = "From" ":" <x:ref>mailbox</x:ref>
     1899<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="From"/><iref primary="true" item="Grammar" subitem="From-v"/>
     1900  <x:ref>From</x:ref>    = "From" <x:ref>BWS</x:ref> ":" <x:ref>OWS</x:ref> <x:ref>From-v</x:ref>
     1901  <x:ref>From-v</x:ref>  = <x:ref>mailbox</x:ref>
    18901902 
    18911903  <x:ref>mailbox</x:ref> = &lt;mailbox, defined in <xref x:sec="3.4" x:fmt="," target="RFC5322"/>&gt;
     
    18951907</t>
    18961908<figure><artwork type="example">
    1897     From: webmaster@example.org
     1909  From: webmaster@example.org
    18981910</artwork></figure>
    18991911<t>
     
    19261938  <iref primary="true" item="Headers" subitem="Location" x:for-anchor=""/>
    19271939  <x:anchor-alias value="Location"/>
    1928 <t>
    1929    The Location response-header field is used for the identification of a
     1940  <x:anchor-alias value="Location-v"/>
     1941<t>
     1942   The response-header field "Location" is used for the identification of a
    19301943   new resource or to redirect the recipient to a location other than the
    19311944   Request-URI for completion of the request.  For 201 (Created)
     
    19351948   field value consists of a single absolute URI.
    19361949</t>
    1937 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Location"/>
    1938   <x:ref>Location</x:ref>       = "Location" ":" <x:ref>absoluteURI</x:ref> [ "#" <x:ref>fragment</x:ref> ]
     1950<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Location"/><iref primary="true" item="Grammar" subitem="Location-v"/>
     1951  <x:ref>Location</x:ref>       = "Location" <x:ref>BWS</x:ref> ":" <x:ref>OWS</x:ref> <x:ref>Location-v</x:ref>
     1952  <x:ref>Location-v</x:ref>     = <x:ref>absoluteURI</x:ref> [ "#" <x:ref>fragment</x:ref> ]
    19391953</artwork></figure>
    19401954<t>
     
    19421956</t>
    19431957<figure><artwork type="example">
    1944     Location: http://www.example.org/pub/WWW/People.html
     1958  Location: http://www.example.org/pub/WWW/People.html
    19451959</artwork></figure>
    19461960<t>
     
    19671981  <iref primary="true" item="Headers" subitem="Max-Forwards" x:for-anchor=""/>
    19681982  <x:anchor-alias value="Max-Forwards"/>
    1969 <t>
    1970    The Max-Forwards request-header field provides a mechanism with the
     1983  <x:anchor-alias value="Max-Forwards-v"/>
     1984<t>
     1985   The request-header "Max-Forwards" field provides a mechanism with the
    19711986   TRACE (<xref target="TRACE"/>) and OPTIONS (<xref target="OPTIONS"/>) methods to limit the
    19721987   number of proxies or gateways that can forward the request to the
     
    19751990   mid-chain.
    19761991</t>
    1977 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Max-Forwards"/>
    1978   <x:ref>Max-Forwards</x:ref>   = "Max-Forwards" ":" 1*<x:ref>DIGIT</x:ref>
     1992<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Max-Forwards"/><iref primary="true" item="Grammar" subitem="Max-Forwards-v"/>
     1993  <x:ref>Max-Forwards</x:ref>   = "Max-Forwards" <x:ref>BWS</x:ref> ":" <x:ref>OWS</x:ref> <x:ref>Max-Forwards-v</x:ref>
     1994  <x:ref>Max-Forwards-v</x:ref> = 1*<x:ref>DIGIT</x:ref>
    19791995</artwork></figure>
    19801996<t>
     
    20022018  <iref primary="true" item="Headers" subitem="Referer" x:for-anchor=""/>
    20032019  <x:anchor-alias value="Referer"/>
    2004 <t>
    2005    The Referer[sic] request-header field allows the client to specify,
     2020  <x:anchor-alias value="Referer-v"/>
     2021<t>
     2022   The request-header field "Referer" [sic] allows the client to specify,
    20062023   for the server's benefit, the address (URI) of the resource from
    20072024   which the Request-URI was obtained (the "referrer", although the
     
    20132030   its own URI, such as input from the user keyboard.
    20142031</t>
    2015 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Referer"/>
    2016   <x:ref>Referer</x:ref>        = "Referer" ":" ( <x:ref>absoluteURI</x:ref> / <x:ref>relativeURI</x:ref> )
     2032<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Referer"/><iref primary="true" item="Grammar" subitem="Referer-v"/>
     2033  <x:ref>Referer</x:ref>        = "Referer" <x:ref>BWS</x:ref> ":" <x:ref>OWS</x:ref> <x:ref>Referer-v</x:ref>
     2034  <x:ref>Referer-v</x:ref>      = <x:ref>absoluteURI</x:ref> / <x:ref>relativeURI</x:ref>
    20172035</artwork></figure>
    20182036<t>
     
    20202038</t>
    20212039<figure><artwork type="example">
    2022     Referer: http://www.example.org/hypertext/Overview.html
     2040  Referer: http://www.example.org/hypertext/Overview.html
    20232041</artwork></figure>
    20242042<t>
     
    20332051  <iref primary="true" item="Headers" subitem="Retry-After" x:for-anchor=""/>
    20342052  <x:anchor-alias value="Retry-After"/>
    2035 <t>
    2036    The Retry-After response-header field can be used with a 503 (Service
     2053  <x:anchor-alias value="Retry-After-v"/>
     2054<t>
     2055   The response-header "Retry-After" field can be used with a 503 (Service
    20372056   Unavailable) response to indicate how long the service is expected to
    20382057   be unavailable to the requesting client. This field &MAY; also be used
     
    20422061   of seconds (in decimal) after the time of the response.
    20432062</t>
    2044 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Retry-After"/>
    2045   <x:ref>Retry-After</x:ref>   = "Retry-After" ":" ( <x:ref>HTTP-date</x:ref> / <x:ref>delta-seconds</x:ref> )
     2063<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Retry-After"/><iref primary="true" item="Grammar" subitem="Retry-After-v"/>
     2064  <x:ref>Retry-After</x:ref>   = "Retry-After" <x:ref>BWS</x:ref> ":" <x:ref>OWS</x:ref> <x:ref>Retry-After-v</x:ref>
     2065  <x:ref>Retry-After-v</x:ref> = <x:ref>HTTP-date</x:ref> / <x:ref>delta-seconds</x:ref>
    20462066</artwork></figure>
    20472067<t anchor="rule.delta-seconds">
     
    20572077</t>
    20582078<figure><artwork type="example">
    2059     Retry-After: Fri, 31 Dec 1999 23:59:59 GMT
    2060     Retry-After: 120
     2079  Retry-After: Fri, 31 Dec 1999 23:59:59 GMT
     2080  Retry-After: 120
    20612081</artwork></figure>
    20622082<t>
     
    20692089  <iref primary="true" item="Headers" subitem="Server" x:for-anchor=""/>
    20702090  <x:anchor-alias value="Server"/>
    2071 <t>
    2072    The Server response-header field contains information about the
     2091  <x:anchor-alias value="Server-v"/>
     2092<t>
     2093   The response-header field "Server" contains information about the
    20732094   software used by the origin server to handle the request. The field
    20742095   can contain multiple product tokens (&product-tokens;) and comments
     
    20772098   application.
    20782099</t>
    2079 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Server"/>
    2080   <x:ref>Server</x:ref>         = "Server" ":" 1*( <x:ref>product</x:ref> / <x:ref>comment</x:ref> )
     2100<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Server"/><iref primary="true" item="Grammar" subitem="Server-v"/>
     2101  <x:ref>Server</x:ref>         = "Server" <x:ref>BWS</x:ref> ":" <x:ref>OWS</x:ref> <x:ref>Server-v</x:ref>
     2102  <x:ref>Server-v</x:ref>       = 1*( <x:ref>product</x:ref> / <x:ref>comment</x:ref> )
    20812103</artwork></figure>
    20822104<t>
     
    20842106</t>
    20852107<figure><artwork type="example">
    2086     Server: CERN/3.0 libwww/2.17
     2108  Server: CERN/3.0 libwww/2.17
    20872109</artwork></figure>
    20882110<t>
     
    21042126  <iref primary="true" item="Headers" subitem="User-Agent" x:for-anchor=""/>
    21052127  <x:anchor-alias value="User-Agent"/>
    2106 <t>
    2107    The User-Agent request-header field contains information about the
     2128  <x:anchor-alias value="User-Agent-v"/>
     2129<t>
     2130   The request-header field "User-Agent" contains information about the
    21082131   user agent originating the request. This is for statistical purposes,
    21092132   the tracing of protocol violations, and automated recognition of user
     
    21162139   application.
    21172140</t>
    2118 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="User-Agent"/>
    2119   <x:ref>User-Agent</x:ref>     = "User-Agent" ":" 1*( <x:ref>product</x:ref> / <x:ref>comment</x:ref> )
     2141<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="User-Agent"/><iref primary="true" item="Grammar" subitem="User-Agent-v"/>
     2142  <x:ref>User-Agent</x:ref>     = "User-Agent" <x:ref>BWS</x:ref> ":" <x:ref>OWS</x:ref> <x:ref>User-Agent-v</x:ref>
     2143  <x:ref>User-Agent-v</x:ref>   = 1*( <x:ref>product</x:ref> / <x:ref>comment</x:ref> )
    21202144</artwork></figure>
    21212145<t>
     
    21232147</t>
    21242148<figure><artwork type="example">
    2125     User-Agent: CERN-LineMode/2.15 libwww/2.17b3
     2149  User-Agent: CERN-LineMode/2.15 libwww/2.17b3
    21262150</artwork></figure>
    21272151</section>
     
    33243348      Use "/" instead of "|" for alternatives.
    33253349    </t>
     3350    <t>
     3351      Introduce new ABNF rules for "bad" whitespace ("BWS"), optional
     3352      whitespace ("OWS") and required whitespace ("RWS"), but do not use
     3353      them yet.
     3354    </t>
     3355    <t>
     3356      Rewrite header ABNFs to spell out whitespace rules, factor out
     3357      value format definitions.
     3358    </t>
    33263359  </list>
    33273360</t>
Note: See TracChangeset for help on using the changeset viewer.