Ignore:
Timestamp:
Dec 16, 2011, 1:11:53 PM (8 years ago)
Author:
julian.reschke@…
Message:

Simplify and correct Expect grammar; rephrase description (see #327)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • draft-ietf-httpbis/latest/p2-semantics.xml

    r1493 r1494  
    365365  <x:anchor-alias value="quoted-string"/>
    366366  <x:anchor-alias value="token"/>
     367  <x:anchor-alias value="BWS"/>
    367368  <x:anchor-alias value="OWS"/>
    368369  <x:anchor-alias value="RWS"/>
     
    371372</t>
    372373<figure><artwork type="abnf2616">
     374  <x:ref>BWS</x:ref>           = &lt;BWS, defined in &basic-rules;&gt;
    373375  <x:ref>OWS</x:ref>           = &lt;OWS, defined in &basic-rules;&gt;
    374376  <x:ref>RWS</x:ref>           = &lt;RWS, defined in &basic-rules;&gt;
     
    25792581  <x:anchor-alias value="Expect"/>
    25802582  <x:anchor-alias value="expectation"/>
    2581   <x:anchor-alias value="expectation-extension"/>
    25822583  <x:anchor-alias value="expect-param"/>
     2584  <x:anchor-alias value="expect-name"/>
     2585  <x:anchor-alias value="expect-value"/>
    25832586<t>
    25842587   The "Expect" header field is used to indicate that particular
    25852588   server behaviors are required by the client.
    25862589</t>
    2587 <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-param"/>
     2590<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Expect"/><iref primary="true" item="Grammar" subitem="expectation"/><iref primary="true" item="Grammar" subitem="expect-param"/><iref primary="true" item="Grammar" subitem="expect-value"/><iref primary="true" item="Grammar" subitem="expect-name"/>
    25882591  <x:ref>Expect</x:ref>       = 1#<x:ref>expectation</x:ref>
    25892592 
    2590   <x:ref>expectation</x:ref>  = "100-continue" / <x:ref>expectation-extension</x:ref>
    2591   <x:ref>expectation-extension</x:ref> = <x:ref>token</x:ref> [ "=" ( <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref> )
    2592                            *(";" <x:ref>expect-param</x:ref>) ]
    2593   <x:ref>expect-param</x:ref> = <x:ref>token</x:ref> [ "=" ( <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref> ) ]
     2593  <x:ref>expectation</x:ref>  = <x:ref>expect-name</x:ref> [ <x:ref>BWS</x:ref> "=" <x:ref>BWS</x:ref> <x:ref>expect-value</x:ref> ]
     2594                             *( <x:ref>OWS</x:ref> ";" [ <x:ref>OWS</x:ref> <x:ref>expect-param</x:ref> ] )
     2595  <x:ref>expect-param</x:ref> = <x:ref>expect-name</x:ref> [ <x:ref>BWS</x:ref> "=" <x:ref>BWS</x:ref> <x:ref>expect-value</x:ref> ]
     2596 
     2597  <x:ref>expect-name</x:ref>  = <x:ref>token</x:ref>
     2598  <x:ref>expect-value</x:ref> = <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref>
    25942599</artwork></figure>
    25952600<t>
    2596    A server that does not understand or is unable to comply with any of
    2597    the expectation values in the Expect field of a request &MUST; respond
    2598    with appropriate error status code. The server &MUST; respond with a 417
    2599    (Expectation Failed) status code if any of the expectations cannot be met
    2600    or, if there are other problems with the request, some other 4xx
    2601    status code.
    2602 </t>
    2603 <t>
    2604    This header field is defined with extensible syntax to allow for
    2605    future extensions. If a server receives a request containing an
    2606    Expect field that includes an expectation-extension that it does not
    2607    support, it &MUST; respond with a 417 (Expectation Failed) status code.
    2608 </t>
    2609 <t>
    2610    Comparison of expectation values is case-insensitive for unquoted
    2611    tokens (including the 100-continue token), and is case-sensitive for
    2612    quoted-string expectation-extensions.
    2613 </t>
    2614 <t>
    2615    The Expect mechanism is hop-by-hop: that is, an HTTP/1.1 proxy &MUST;
    2616    return a 417 (Expectation Failed) status code if it receives a request
    2617    with an expectation that it cannot meet. However, the Expect
    2618    header field itself is end-to-end; it &MUST; be forwarded if the
    2619    request is forwarded.
    2620 </t>
    2621 <t>
    2622    Many older HTTP/1.0 and HTTP/1.1 applications do not understand the
    2623    Expect header field.
    2624 </t>
    2625 <t>
    2626    See &use100; for the use of the 100 (Continue) status code.
     2601   If all received Expect header field(s) are syntactically valid but contain
     2602   an expectation that the recipient does not understand or cannot comply with,
     2603   the recipient &MUST; respond with a 417 (Expectation Failed) status code. A
     2604   recipient of a syntactically invalid Expectation header field &MUST; respond
     2605   with a 4xx status code other than 417.
     2606</t>
     2607<t>
     2608   The only expectation defined by this specification is:
     2609</t>
     2610<t><iref primary="true" item="100-continue (expect value)"/><iref primary="true" item="Expect Values" subitem="100-continue"/>
     2611  100-continue
     2612   <list>
     2613      <t>
     2614        The "100-continue" expectation is defined &use100;. It does not support
     2615        any expect-params.
     2616      </t>
     2617   </list>
     2618</t>
     2619<t>
     2620   Comparison is case-insensitive for names (expect-name), and case-sensitive
     2621   for values (expect-value).
     2622</t>
     2623<t>
     2624   The Expect mechanism is hop-by-hop: the above requirements apply to any
     2625   server, including proxies. However, the Expect header field itself is
     2626   end-to-end; it &MUST; be forwarded if the request is forwarded.
     2627</t>
     2628<t>
     2629   Many older HTTP/1.0 and HTTP/1.1 applications do not understand the Expect
     2630   header field.
    26272631</t>
    26282632</section>
     
    40334037<x:ref>Allow</x:ref> = [ ( "," / Method ) *( OWS "," [ OWS Method ] ) ]
    40344038
     4039<x:ref>BWS</x:ref> = &lt;BWS, defined in [Part1], Section 1.2.2&gt;
     4040
    40354041<x:ref>Date</x:ref> = HTTP-date
    40364042
     
    40864092<x:ref>delta-seconds</x:ref> = 1*DIGIT
    40874093
    4088 <x:ref>expect-param</x:ref> = token [ "=" ( token / quoted-string ) ]
    4089 <x:ref>expectation</x:ref> = "100-continue" / expectation-extension
    4090 <x:ref>expectation-extension</x:ref> = token [ "=" ( token / quoted-string ) *( ";"
    4091  expect-param ) ]
     4094<x:ref>expect-name</x:ref> = token
     4095<x:ref>expect-param</x:ref> = expect-name [ BWS "=" BWS expect-value ]
     4096<x:ref>expect-value</x:ref> = token / quoted-string
     4097<x:ref>expectation</x:ref> = expect-name [ BWS "=" BWS expect-value ] *( OWS ";" [
     4098 OWS expect-param ] )
    40924099
    40934100<x:ref>hour</x:ref> = 2DIGIT
     
    47084715    </t>
    47094716    <t>
     4717      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/327"/>:
     4718      "'expect' grammar missing OWS"
     4719    </t>
     4720    <t>
    47104721      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/329"/>:
    47114722      "header field considerations: quoted-string vs use of double quotes"
Note: See TracChangeset for help on using the changeset viewer.