Changeset 2339
- Timestamp:
- 02/08/13 02:59:29 (9 years ago)
- Location:
- draft-ietf-httpbis/latest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/p1-messaging.html
r2338 r2339 616 616 <li><a href="#rfc.section.4">4.</a> <a href="#transfer.codings">Transfer Codings</a><ul> 617 617 <li><a href="#rfc.section.4.1">4.1</a> <a href="#chunked.encoding">Chunked Transfer Coding</a><ul> 618 <li><a href="#rfc.section.4.1.1">4.1.1</a> <a href="# header.trailer">Trailer</a></li>619 <li><a href="#rfc.section.4.1.2">4.1.2</a> <a href="#decoding.chunked">Decoding chunked</a></li>618 <li><a href="#rfc.section.4.1.1">4.1.1</a> <a href="#chunked.trailer.part">Chunked Trailer Part</a></li> 619 <li><a href="#rfc.section.4.1.2">4.1.2</a> <a href="#decoding.chunked">Decoding Chunked</a></li> 620 620 </ul> 621 621 </li> … … 627 627 </li> 628 628 <li><a href="#rfc.section.4.3">4.3</a> <a href="#header.te">TE</a></li> 629 <li><a href="#rfc.section.4.4">4.4</a> <a href="#header.trailer">Trailer</a></li> 629 630 </ul> 630 631 </li> … … 1597 1598 <div id="rfc.figure.u.32"></div><pre class="inline"><span id="rfc.iref.g.64"></span><span id="rfc.iref.g.65"></span><span id="rfc.iref.g.66"></span><span id="rfc.iref.g.67"></span><span id="rfc.iref.g.68"></span><span id="rfc.iref.g.69"></span><span id="rfc.iref.g.70"></span><span id="rfc.iref.g.71"></span><span id="rfc.iref.g.72"></span><span id="rfc.iref.g.73"></span><span id="rfc.iref.g.74"></span> <a href="#chunked.encoding" class="smpl">chunked-body</a> = *<a href="#chunked.encoding" class="smpl">chunk</a> 1598 1599 <a href="#chunked.encoding" class="smpl">last-chunk</a> 1599 <a href="#chunked. encoding" class="smpl">trailer-part</a>1600 <a href="#chunked.trailer.part" class="smpl">trailer-part</a> 1600 1601 <a href="#core.rules" class="smpl">CRLF</a> 1601 1602 … … 1609 1610 <a href="#chunked.encoding" class="smpl">chunk-ext-val</a> = <a href="#rule.token.separators" class="smpl">token</a> / <a href="#chunked.encoding" class="smpl">quoted-str-nf</a> 1610 1611 <a href="#chunked.encoding" class="smpl">chunk-data</a> = 1*<a href="#core.rules" class="smpl">OCTET</a> ; a sequence of chunk-size octets 1611 <a href="#chunked.encoding" class="smpl">trailer-part</a> = *( <a href="#header.fields" class="smpl">header-field</a> <a href="#core.rules" class="smpl">CRLF</a> )1612 1612 1613 1613 <a href="#chunked.encoding" class="smpl">quoted-str-nf</a> = <a href="#core.rules" class="smpl">DQUOTE</a> *( <a href="#chunked.encoding" class="smpl">qdtext-nf</a> / <a href="#rule.quoted-pair" class="smpl">quoted-pair</a> ) <a href="#core.rules" class="smpl">DQUOTE</a> … … 1620 1620 an empty line. 1621 1621 </p> 1622 <div id="rfc.iref.t.5"></div> 1623 <h3 id="rfc.section.4.1.1"><a href="#rfc.section.4.1.1">4.1.1</a> <a id="header.trailer" href="#header.trailer">Trailer</a></h3> 1622 <h3 id="rfc.section.4.1.1"><a href="#rfc.section.4.1.1">4.1.1</a> <a id="chunked.trailer.part" href="#chunked.trailer.part">Chunked Trailer Part</a></h3> 1624 1623 <p id="rfc.section.4.1.1.p.1">A trailer allows the sender to include additional fields at the end of a chunked message in order to supply metadata that 1625 1624 might be dynamically generated while the message body is sent, such as a message integrity check, digital signature, or post-processing … … 1627 1626 header block. 1628 1627 </p> 1629 <p id="rfc.section.4.1.1.p.2">When a message includes a message body encoded with the chunked transfer coding and the sender desires to send metadata in 1630 the form of trailer fields at the end of the message, the sender <em class="bcp14">SHOULD</em> generate a <a href="#header.trailer" class="smpl">Trailer</a> header field before the message body to indicate which fields will be present in the trailers. This allows the recipient to 1631 prepare for receipt of that metadata before it starts processing the body, which is useful if the message is being streamed 1632 and the recipient wishes to confirm an integrity check on the fly. 1633 </p> 1634 <div id="rfc.figure.u.33"></div><pre class="inline"><span id="rfc.iref.g.75"></span> <a href="#header.trailer" class="smpl">Trailer</a> = 1#<a href="#header.fields" class="smpl">field-name</a> 1635 </pre><p id="rfc.section.4.1.1.p.4">A sender <em class="bcp14">MUST NOT</em> generate a trailer that contains a field which needs to be known by the recipient before it can begin processing the message 1628 <div id="rfc.figure.u.33"></div><pre class="inline"><span id="rfc.iref.g.75"></span> <a href="#chunked.trailer.part" class="smpl">trailer-part</a> = *( <a href="#header.fields" class="smpl">header-field</a> <a href="#core.rules" class="smpl">CRLF</a> ) 1629 </pre><p id="rfc.section.4.1.1.p.3">A sender <em class="bcp14">MUST NOT</em> generate a trailer that contains a field which needs to be known by the recipient before it can begin processing the message 1636 1630 body. For example, most recipients need to know the values of <a href="p2-semantics.html#header.content-encoding" class="smpl">Content-Encoding</a> and <a href="p2-semantics.html#header.content-type" class="smpl">Content-Type</a> in order to select a content handler, so placing those fields in a trailer would force the recipient to buffer the entire 1637 1631 body before it could begin, greatly increasing user-perceived latency and defeating one of the main advantages of using chunked 1638 1632 to send data streams of unknown length. A sender <em class="bcp14">MUST NOT</em> generate a trailer containing a <a href="#header.transfer-encoding" class="smpl">Transfer-Encoding</a>, <a href="#header.content-length" class="smpl">Content-Length</a>, or <a href="#header.trailer" class="smpl">Trailer</a> field. 1639 1633 </p> 1640 <p id="rfc.section.4.1.1.p. 5">A server <em class="bcp14">MUST</em> generate an empty trailer with the chunked transfer coding unless at least one of the following is true:1634 <p id="rfc.section.4.1.1.p.4">A server <em class="bcp14">MUST</em> generate an empty trailer with the chunked transfer coding unless at least one of the following is true: 1641 1635 </p> 1642 1636 <ol> … … 1648 1642 </li> 1649 1643 </ol> 1650 <p id="rfc.section.4.1.1.p. 6">The above requirement prevents the need for an infinite buffer when a message is being received by an HTTP/1.1 (or later)1644 <p id="rfc.section.4.1.1.p.5">The above requirement prevents the need for an infinite buffer when a message is being received by an HTTP/1.1 (or later) 1651 1645 proxy and forwarded to an HTTP/1.0 recipient. 1652 1646 </p> 1653 <h3 id="rfc.section.4.1.2"><a href="#rfc.section.4.1.2">4.1.2</a> <a id="decoding.chunked" href="#decoding.chunked">Decoding chunked</a></h3>1647 <h3 id="rfc.section.4.1.2"><a href="#rfc.section.4.1.2">4.1.2</a> <a id="decoding.chunked" href="#decoding.chunked">Decoding Chunked</a></h3> 1654 1648 <p id="rfc.section.4.1.2.p.1">A process for decoding the chunked transfer coding can be represented in pseudo-code as:</p> 1655 1649 <div id="rfc.figure.u.34"></div><pre class="text"> length := 0 … … 1689 1683 <p id="rfc.section.4.2.3.p.1">The "gzip" coding is an LZ77 coding with a 32 bit CRC that is commonly produced by the gzip file compression program <a href="#RFC1952" id="rfc.xref.RFC1952.1"><cite title="GZIP file format specification version 4.3">[RFC1952]</cite></a>. Recipients <em class="bcp14">SHOULD</em> consider "x-gzip" to be equivalent to "gzip". 1690 1684 </p> 1691 <div id="rfc.iref.t. 6"></div>1685 <div id="rfc.iref.t.5"></div> 1692 1686 <h2 id="rfc.section.4.3"><a href="#rfc.section.4.3">4.3</a> <a id="header.te" href="#header.te">TE</a></h2> 1693 1687 <p id="rfc.section.4.3.p.1">The "TE" header field in a request indicates what transfer codings, besides chunked, the client is willing to accept in response, … … 1707 1701 TE: trailers, deflate;q=0.5 1708 1702 </pre><p id="rfc.section.4.3.p.6">The presence of the keyword "trailers" indicates that the client is willing to accept trailer fields in a chunked transfer 1709 coding, as defined in <a href="#chunked. encoding" title="Chunked Transfer Coding">Section 4.1</a>, on behalf of itself and any downstream clients. For requests from an intermediary, this implies that either: (a) all downstream1703 coding, as defined in <a href="#chunked.trailer.part" title="Chunked Trailer Part">Section 4.1.1</a>, on behalf of itself and any downstream clients. For requests from an intermediary, this implies that either: (a) all downstream 1710 1704 clients are willing to accept trailer fields in the forwarded response; or, (b) the intermediary will attempt to buffer the 1711 1705 response on behalf of downstream recipients. Note that HTTP/1.1 does not define any means to limit the size of a chunked response … … 1721 1715 <p id="rfc.section.4.3.p.9">Since the TE header field only applies to the immediate connection, a sender of TE <em class="bcp14">MUST</em> also send a "TE" connection option within the <a href="#header.connection" class="smpl">Connection</a> header field (<a href="#header.connection" id="rfc.xref.header.connection.2" title="Connection">Section 6.1</a>) in order to prevent the TE field from being forwarded by intermediaries that do not support its semantics. 1722 1716 </p> 1723 <h1 id="rfc.section.5"><a href="#rfc.section.5">5.</a> <a id="message.routing" href="#message.routing">Message Routing</a></h1> 1717 <div id="rfc.iref.t.6"></div> 1718 <h2 id="rfc.section.4.4"><a href="#rfc.section.4.4">4.4</a> <a id="header.trailer" href="#header.trailer">Trailer</a></h2> 1719 <p id="rfc.section.4.4.p.1">When a message includes a message body encoded with the chunked transfer coding and the sender desires to send metadata in 1720 the form of trailer fields at the end of the message, the sender <em class="bcp14">SHOULD</em> generate a <a href="#header.trailer" class="smpl">Trailer</a> header field before the message body to indicate which fields will be present in the trailers. This allows the recipient to 1721 prepare for receipt of that metadata before it starts processing the body, which is useful if the message is being streamed 1722 and the recipient wishes to confirm an integrity check on the fly. 1723 </p> 1724 <div id="rfc.figure.u.37"></div><pre class="inline"><span id="rfc.iref.g.81"></span> <a href="#header.trailer" class="smpl">Trailer</a> = 1#<a href="#header.fields" class="smpl">field-name</a> 1725 </pre><h1 id="rfc.section.5"><a href="#rfc.section.5">5.</a> <a id="message.routing" href="#message.routing">Message Routing</a></h1> 1724 1726 <p id="rfc.section.5.p.1">HTTP request message routing is determined by each client based on the target resource, the client's proxy configuration, 1725 1727 and establishment or reuse of an inbound connection. The corresponding response routing follows the same connection chain … … 1759 1761 both the method being requested and whether the request is to a proxy. 1760 1762 </p> 1761 <div id="rfc.figure.u.3 7"></div><pre class="inline"><span id="rfc.iref.g.81"></span><span id="rfc.iref.g.82"></span><span id="rfc.iref.g.83"></span><span id="rfc.iref.g.84"></span><span id="rfc.iref.g.85"></span> <a href="#request-target" class="smpl">request-target</a> = <a href="#origin-form" class="smpl">origin-form</a>1763 <div id="rfc.figure.u.38"></div><pre class="inline"><span id="rfc.iref.g.82"></span><span id="rfc.iref.g.83"></span><span id="rfc.iref.g.84"></span><span id="rfc.iref.g.85"></span><span id="rfc.iref.g.86"></span> <a href="#request-target" class="smpl">request-target</a> = <a href="#origin-form" class="smpl">origin-form</a> 1762 1764 / <a href="#absolute-form" class="smpl">absolute-form</a> 1763 1765 / <a href="#authority-form" class="smpl">authority-form</a> … … 1777 1779 </p> 1778 1780 <p id="rfc.section.5.3.p.5">For example, a client wishing to retrieve a representation of the resource identified as</p> 1779 <div id="rfc.figure.u.3 8"></div><pre class="text">http://www.example.org/where?q=now1781 <div id="rfc.figure.u.39"></div><pre class="text">http://www.example.org/where?q=now 1780 1782 </pre><p id="rfc.section.5.3.p.7">directly from the origin server would open (or reuse) a TCP connection to port 80 of the host "www.example.org" and send the 1781 1783 lines: 1782 1784 </p> 1783 <div id="rfc.figure.u. 39"></div><pre class="text2">GET /where?q=now HTTP/1.11785 <div id="rfc.figure.u.40"></div><pre class="text2">GET /where?q=now HTTP/1.1 1784 1786 Host: www.example.org 1785 1787 </pre><p id="rfc.section.5.3.p.9">followed by the remainder of the request message.</p> … … 1793 1795 </p> 1794 1796 <p id="rfc.section.5.3.p.12">An example absolute-form of request-line would be:</p> 1795 <div id="rfc.figure.u.4 0"></div><pre class="text2">GET http://www.example.org/pub/WWW/TheProject.html HTTP/1.11797 <div id="rfc.figure.u.41"></div><pre class="text2">GET http://www.example.org/pub/WWW/TheProject.html HTTP/1.1 1796 1798 </pre><p id="rfc.section.5.3.p.14">To allow for transition to the absolute-form for all requests in some future version of HTTP, HTTP/1.1 servers <em class="bcp14">MUST</em> accept the absolute-form in requests, even though HTTP/1.1 clients will only send them in requests to proxies. 1797 1799 </p> … … 1802 1804 <p id="rfc.section.5.3.p.16">The <dfn>authority-form</dfn> of request-target is only used for CONNECT requests (<a href="p2-semantics.html#CONNECT" title="CONNECT">Section 4.3.6</a> of <a href="#Part2" id="rfc.xref.Part2.19"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a>). When making a CONNECT request to establish a tunnel through one or more proxies, a client <em class="bcp14">MUST</em> send only the target URI's authority component (excluding any userinfo and its "@" delimiter) as the request-target. For example, 1803 1805 </p> 1804 <div id="rfc.figure.u.4 1"></div><pre class="text2">CONNECT www.example.com:80 HTTP/1.11806 <div id="rfc.figure.u.42"></div><pre class="text2">CONNECT www.example.com:80 HTTP/1.1 1805 1807 </pre><div id="asterisk-form"> 1806 1808 <p id="rfc.section.5.3.p.18"><span id="rfc.iref.a.4"></span> <b>asterisk-form</b> … … 1810 1812 the client <em class="bcp14">MUST</em> send only "*" (%x2A) as the request-target. For example, 1811 1813 </p> 1812 <div id="rfc.figure.u.4 2"></div><pre class="text2">OPTIONS * HTTP/1.11814 <div id="rfc.figure.u.43"></div><pre class="text2">OPTIONS * HTTP/1.1 1813 1815 </pre><p id="rfc.section.5.3.p.21">If a proxy receives an OPTIONS request with an absolute-form of request-target in which the URI has an empty path and no query 1814 1816 component, then the last proxy on the request chain <em class="bcp14">MUST</em> send a request-target of "*" when it forwards the request to the indicated origin server. 1815 1817 </p> 1816 <div id="rfc.figure.u.4 3"></div>1818 <div id="rfc.figure.u.44"></div> 1817 1819 <p>For example, the request</p><pre class="text2">OPTIONS http://www.example.org:8001 HTTP/1.1 1818 </pre><div id="rfc.figure.u.4 4"></div>1820 </pre><div id="rfc.figure.u.45"></div> 1819 1821 <p>would be forwarded by the final proxy as</p><pre class="text2">OPTIONS * HTTP/1.1 1820 1822 Host: www.example.org:8001 … … 1825 1827 to distinguish among resources while servicing requests for multiple host names on a single IP address. 1826 1828 </p> 1827 <div id="rfc.figure.u.4 5"></div><pre class="inline"><span id="rfc.iref.g.86"></span> <a href="#header.host" class="smpl">Host</a> = <a href="#uri" class="smpl">uri-host</a> [ ":" <a href="#uri" class="smpl">port</a> ] ; <a href="#http.uri" title="http URI scheme">Section 2.7.1</a>1829 <div id="rfc.figure.u.46"></div><pre class="inline"><span id="rfc.iref.g.87"></span> <a href="#header.host" class="smpl">Host</a> = <a href="#uri" class="smpl">uri-host</a> [ ":" <a href="#uri" class="smpl">port</a> ] ; <a href="#http.uri" title="http URI scheme">Section 2.7.1</a> 1828 1830 </pre><p id="rfc.section.5.4.p.3">A client <em class="bcp14">MUST</em> send a Host header field in all HTTP/1.1 request messages. If the target URI includes an authority component, then a client <em class="bcp14">MUST</em> send a field-value for Host that is identical to that authority component, excluding any userinfo subcomponent and its "@" 1829 1831 delimiter (<a href="#http.uri" title="http URI scheme">Section 2.7.1</a>). If the authority component is missing or undefined for the target URI, then a client <em class="bcp14">MUST</em> send a Host header field with an empty field-value. … … 1832 1834 </p> 1833 1835 <p id="rfc.section.5.4.p.5">For example, a GET request to the origin server for <http://www.example.org/pub/WWW/> would begin with:</p> 1834 <div id="rfc.figure.u.4 6"></div><pre class="text2">GET /pub/WWW/ HTTP/1.11836 <div id="rfc.figure.u.47"></div><pre class="text2">GET /pub/WWW/ HTTP/1.1 1835 1837 Host: www.example.org 1836 1838 </pre><p id="rfc.section.5.4.p.7">A client <em class="bcp14">MUST</em> send a Host header field in an HTTP/1.1 request even if the request-target is in the absolute-form, since this allows the … … 1871 1873 the scheme, "://", authority, and combined path and query component. 1872 1874 </p> 1873 <div id="rfc.figure.u.4 7"></div>1875 <div id="rfc.figure.u.48"></div> 1874 1876 <p>Example 1: the following message received over an insecure TCP connection</p><pre class="text">GET /pub/WWW/TheProject.html HTTP/1.1 1875 1877 Host: www.example.org:8080 1876 </pre><div id="rfc.figure.u.4 8"></div>1878 </pre><div id="rfc.figure.u.49"></div> 1877 1879 <p>has an effective request URI of</p><pre class="text">http://www.example.org:8080/pub/WWW/TheProject.html 1878 </pre><div id="rfc.figure.u. 49"></div>1880 </pre><div id="rfc.figure.u.50"></div> 1879 1881 <p>Example 2: the following message received over a TLS-secured TCP connection</p><pre class="text">OPTIONS * HTTP/1.1 1880 1882 Host: www.example.org 1881 </pre><div id="rfc.figure.u.5 0"></div>1883 </pre><div id="rfc.figure.u.51"></div> 1882 1884 <p>has an effective request URI of</p><pre class="text">https://www.example.org 1883 1885 </pre><p id="rfc.section.5.5.p.12">An origin server that does not allow resources to differ by requested host <em class="bcp14">MAY</em> ignore the <a href="#header.host" class="smpl">Host</a> field-value and instead replace it with a configured server name when constructing the effective request URI. … … 1912 1914 along the request/response chain. 1913 1915 </p> 1914 <div id="rfc.figure.u.5 1"></div><pre class="inline"><span id="rfc.iref.g.87"></span><span id="rfc.iref.g.88"></span><span id="rfc.iref.g.89"></span><span id="rfc.iref.g.90"></span><span id="rfc.iref.g.91"></span><span id="rfc.iref.g.92"></span> <a href="#header.via" class="smpl">Via</a> = 1#( <a href="#header.via" class="smpl">received-protocol</a> <a href="#rule.whitespace" class="smpl">RWS</a> <a href="#header.via" class="smpl">received-by</a> [ <a href="#rule.whitespace" class="smpl">RWS</a> <a href="#rule.comment" class="smpl">comment</a> ] )1916 <div id="rfc.figure.u.52"></div><pre class="inline"><span id="rfc.iref.g.88"></span><span id="rfc.iref.g.89"></span><span id="rfc.iref.g.90"></span><span id="rfc.iref.g.91"></span><span id="rfc.iref.g.92"></span><span id="rfc.iref.g.93"></span> <a href="#header.via" class="smpl">Via</a> = 1#( <a href="#header.via" class="smpl">received-protocol</a> <a href="#rule.whitespace" class="smpl">RWS</a> <a href="#header.via" class="smpl">received-by</a> [ <a href="#rule.whitespace" class="smpl">RWS</a> <a href="#rule.comment" class="smpl">comment</a> ] ) 1915 1917 1916 1918 <a href="#header.via" class="smpl">received-protocol</a> = [ <a href="#header.upgrade" class="smpl">protocol-name</a> "/" ] <a href="#header.upgrade" class="smpl">protocol-version</a> … … 1938 1940 server at www.example.com. The request received by www.example.com would then have the following Via header field: 1939 1941 </p> 1940 <div id="rfc.figure.u.5 2"></div><pre class="text"> Via: 1.0 fred, 1.1 p.example.net1942 <div id="rfc.figure.u.53"></div><pre class="text"> Via: 1.0 fred, 1.1 p.example.net 1941 1943 </pre><p id="rfc.section.5.7.1.p.10">An intermediary used as a portal through a network firewall <em class="bcp14">SHOULD NOT</em> forward the names and ports of hosts within the firewall region unless it is explicitly enabled to do so. If not enabled, 1942 1944 such an intermediary <em class="bcp14">SHOULD</em> replace each received-by host of any host behind the firewall by an appropriate pseudonym for that host. … … 1945 1947 values. For example, 1946 1948 </p> 1947 <div id="rfc.figure.u.5 3"></div><pre class="text"> Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy1949 <div id="rfc.figure.u.54"></div><pre class="text"> Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy 1948 1950 </pre><p id="rfc.section.5.7.1.p.13">could be collapsed to</p> 1949 <div id="rfc.figure.u.5 4"></div><pre class="text"> Via: 1.0 ricky, 1.1 mertz, 1.0 lucy1951 <div id="rfc.figure.u.55"></div><pre class="text"> Via: 1.0 ricky, 1.1 mertz, 1.0 lucy 1950 1952 </pre><p id="rfc.section.5.7.1.p.15">Senders <em class="bcp14">SHOULD NOT</em> combine multiple entries unless they are all under the same organizational control and the hosts have already been replaced 1951 1953 by pseudonyms. Senders <em class="bcp14">MUST NOT</em> combine entries that have different received-protocol values. … … 2003 2005 </p> 2004 2006 <p id="rfc.section.6.1.p.4">The Connection header field's value has the following grammar:</p> 2005 <div id="rfc.figure.u.5 5"></div><pre class="inline"><span id="rfc.iref.g.93"></span><span id="rfc.iref.g.94"></span> <a href="#header.connection" class="smpl">Connection</a> = 1#<a href="#header.connection" class="smpl">connection-option</a>2007 <div id="rfc.figure.u.56"></div><pre class="inline"><span id="rfc.iref.g.94"></span><span id="rfc.iref.g.95"></span> <a href="#header.connection" class="smpl">Connection</a> = 1#<a href="#header.connection" class="smpl">connection-option</a> 2006 2008 <a href="#header.connection" class="smpl">connection-option</a> = <a href="#rule.token.separators" class="smpl">token</a> 2007 2009 </pre><p id="rfc.section.6.1.p.6">Connection options are case-insensitive.</p> … … 2023 2025 For example, 2024 2026 </p> 2025 <div id="rfc.figure.u.5 6"></div><pre class="text"> Connection: close2027 <div id="rfc.figure.u.57"></div><pre class="text"> Connection: close 2026 2028 </pre><p id="rfc.section.6.1.p.12">in either the request or the response header fields indicates that the sender is going to close the connection after the current 2027 2029 request/response is complete (<a href="#persistent.tear-down" id="rfc.xref.persistent.tear-down.1" title="Tear-down">Section 6.6</a>). … … 2158 2160 in order of descending preference, before sending the final response. A server <em class="bcp14">MAY</em> ignore a received Upgrade header field if it wishes to continue using the current protocol on that connection. 2159 2161 </p> 2160 <div id="rfc.figure.u.5 7"></div><pre class="inline"><span id="rfc.iref.g.95"></span> <a href="#header.upgrade" class="smpl">Upgrade</a> = 1#<a href="#header.upgrade" class="smpl">protocol</a>2162 <div id="rfc.figure.u.58"></div><pre class="inline"><span id="rfc.iref.g.96"></span> <a href="#header.upgrade" class="smpl">Upgrade</a> = 1#<a href="#header.upgrade" class="smpl">protocol</a> 2161 2163 2162 2164 <a href="#header.upgrade" class="smpl">protocol</a> = <a href="#header.upgrade" class="smpl">protocol-name</a> ["/" <a href="#header.upgrade" class="smpl">protocol-version</a>] … … 2172 2174 in order of descending preference, when appropriate for a future request. 2173 2175 </p> 2174 <div id="rfc.figure.u.5 8"></div>2176 <div id="rfc.figure.u.59"></div> 2175 2177 <p>The following is a hypothetical example sent by a client:</p><pre class="text2">GET /hello.txt HTTP/1.1 2176 2178 Host: www.example.com … … 2190 2192 by any protocol. 2191 2193 </p> 2192 <div id="rfc.figure.u. 59"></div>2194 <div id="rfc.figure.u.60"></div> 2193 2195 <p>The following is an example response to the above hypothetical request:</p><pre class="text">HTTP/1.1 101 Switching Protocols 2194 2196 Connection: upgrade … … 2259 2261 <td class="left">http</td> 2260 2262 <td class="left">standard</td> 2261 <td class="left"><a href="#header.trailer" id="rfc.xref.header.trailer.1" title="Trailer">Section 4. 1.1</a>2263 <td class="left"><a href="#header.trailer" id="rfc.xref.header.trailer.1" title="Trailer">Section 4.4</a> 2262 2264 </td> 2263 2265 </tr> … … 3030 3032 indicating at least <n> and at most <m> elements, each separated by a single comma (",") and optional whitespace (OWS). 3031 3033 </p> 3032 <div id="rfc.figure.u.6 0"></div>3034 <div id="rfc.figure.u.61"></div> 3033 3035 <p>Thus,</p><pre class="text"> 1#element => element *( OWS "," OWS element ) 3034 </pre><div id="rfc.figure.u.6 1"></div>3036 </pre><div id="rfc.figure.u.62"></div> 3035 3037 <p>and:</p><pre class="text"> #element => [ 1#element ] 3036 </pre><div id="rfc.figure.u.6 2"></div>3038 </pre><div id="rfc.figure.u.63"></div> 3037 3039 <p>and for n >= 1 and m > 1:</p><pre class="text"> <n>#<m>element => element <n-1>*<m-1>( OWS "," OWS element ) 3038 3040 </pre><p id="rfc.section.B.p.6">For compatibility with legacy list rules, recipients <em class="bcp14">SHOULD</em> accept empty list elements. In other words, consumers would follow the list productions: 3039 3041 </p> 3040 <div id="rfc.figure.u.6 3"></div><pre class="text"> #element => [ ( "," / element ) *( OWS "," [ OWS element ] ) ]3042 <div id="rfc.figure.u.64"></div><pre class="text"> #element => [ ( "," / element ) *( OWS "," [ OWS element ] ) ] 3041 3043 3042 3044 1#element => *( "," OWS ) element *( OWS "," [ OWS element ] ) 3043 3045 </pre><p id="rfc.section.B.p.8">Note that empty elements do not contribute to the count of elements present, though.</p> 3044 3046 <p id="rfc.section.B.p.9">For example, given these ABNF productions:</p> 3045 <div id="rfc.figure.u.6 4"></div><pre class="text"> example-list = 1#example-list-elmt3047 <div id="rfc.figure.u.65"></div><pre class="text"> example-list = 1#example-list-elmt 3046 3048 example-list-elmt = token ; see <a href="#field.components" title="Field value components">Section 3.2.6</a> 3047 3049 </pre><p id="rfc.section.B.p.11">Then these are valid values for example-list (not including the double quotes, which are present for delimitation only):</p> 3048 <div id="rfc.figure.u.6 5"></div><pre class="text"> "foo,bar"3050 <div id="rfc.figure.u.66"></div><pre class="text"> "foo,bar" 3049 3051 "foo ,bar," 3050 3052 "foo , ,bar,charlie " 3051 3053 </pre><p id="rfc.section.B.p.13">But these values would be invalid, as at least one non-empty element is required:</p> 3052 <div id="rfc.figure.u.6 6"></div><pre class="text"> ""3054 <div id="rfc.figure.u.67"></div><pre class="text"> "" 3053 3055 "," 3054 3056 ", ," … … 3056 3058 </p> 3057 3059 <h1 id="rfc.section.C"><a href="#rfc.section.C">C.</a> <a id="collected.abnf" href="#collected.abnf">Collected ABNF</a></h1> 3058 <div id="rfc.figure.u.6 7"></div><pre class="inline"><a href="#rule.whitespace" class="smpl">BWS</a> = OWS3060 <div id="rfc.figure.u.68"></div><pre class="inline"><a href="#rule.whitespace" class="smpl">BWS</a> = OWS 3059 3061 3060 3062 <a href="#header.connection" class="smpl">Connection</a> = *( "," OWS ) connection-option *( OWS "," [ OWS … … 3167 3169 "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA 3168 3170 <a href="#rule.token.separators" class="smpl">token</a> = 1*tchar 3169 <a href="#chunked. encoding" class="smpl">trailer-part</a> = *( header-field CRLF )3171 <a href="#chunked.trailer.part" class="smpl">trailer-part</a> = *( header-field CRLF ) 3170 3172 <a href="#transfer.codings" class="smpl">transfer-coding</a> = "chunked" / "compress" / "deflate" / "gzip" / 3171 3173 transfer-extension … … 3315 3317 <li><tt>Grammar</tt> 3316 3318 <ul> 3317 <li><tt>absolute-form</tt> <a href="#rfc.iref.g.8 3"><b>5.3</b></a></li>3319 <li><tt>absolute-form</tt> <a href="#rfc.iref.g.84"><b>5.3</b></a></li> 3318 3320 <li><tt>absolute-path</tt> <a href="#rfc.iref.g.19"><b>2.7</b></a></li> 3319 3321 <li><tt>absolute-URI</tt> <a href="#rfc.iref.g.17"><b>2.7</b></a></li> 3320 3322 <li>ALPHA <a href="#rfc.iref.g.1"><b>1.2</b></a></li> 3321 <li><tt>asterisk-form</tt> <a href="#rfc.iref.g.8 5"><b>5.3</b></a></li>3323 <li><tt>asterisk-form</tt> <a href="#rfc.iref.g.86"><b>5.3</b></a></li> 3322 3324 <li><tt>attribute</tt> <a href="#rfc.iref.g.60"><b>4</b></a></li> 3323 3325 <li><tt>authority</tt> <a href="#rfc.iref.g.18"><b>2.7</b></a></li> 3324 <li><tt>authority-form</tt> <a href="#rfc.iref.g.8 4"><b>5.3</b></a></li>3326 <li><tt>authority-form</tt> <a href="#rfc.iref.g.85"><b>5.3</b></a></li> 3325 3327 <li><tt>BWS</tt> <a href="#rfc.iref.g.42"><b>3.2.3</b></a></li> 3326 3328 <li><tt>chunk</tt> <a href="#rfc.iref.g.65"><b>4.1</b></a></li> … … 3332 3334 <li><tt>chunked-body</tt> <a href="#rfc.iref.g.64"><b>4.1</b></a></li> 3333 3335 <li><tt>comment</tt> <a href="#rfc.iref.g.51"><b>3.2.6</b></a></li> 3334 <li><tt>Connection</tt> <a href="#rfc.iref.g.9 3"><b>6.1</b></a></li>3335 <li><tt>connection-option</tt> <a href="#rfc.iref.g.9 4"><b>6.1</b></a></li>3336 <li><tt>Connection</tt> <a href="#rfc.iref.g.94"><b>6.1</b></a></li> 3337 <li><tt>connection-option</tt> <a href="#rfc.iref.g.95"><b>6.1</b></a></li> 3336 3338 <li><tt>Content-Length</tt> <a href="#rfc.iref.g.56"><b>3.3.2</b></a></li> 3337 3339 <li>CR <a href="#rfc.iref.g.2"><b>1.2</b></a></li> … … 3349 3351 <li><tt>header-field</tt> <a href="#rfc.iref.g.35"><b>3.2</b></a></li> 3350 3352 <li>HEXDIG <a href="#rfc.iref.g.7"><b>1.2</b></a></li> 3351 <li><tt>Host</tt> <a href="#rfc.iref.g.8 6"><b>5.4</b></a></li>3353 <li><tt>Host</tt> <a href="#rfc.iref.g.87"><b>5.4</b></a></li> 3352 3354 <li>HTAB <a href="#rfc.iref.g.8"><b>1.2</b></a></li> 3353 3355 <li><tt>HTTP-message</tt> <a href="#rfc.iref.g.28"><b>3</b></a></li> … … 3363 3365 <li><tt>obs-text</tt> <a href="#rfc.iref.g.49"><b>3.2.6</b></a></li> 3364 3366 <li>OCTET <a href="#rfc.iref.g.10"><b>1.2</b></a></li> 3365 <li><tt>origin-form</tt> <a href="#rfc.iref.g.8 2"><b>5.3</b></a></li>3367 <li><tt>origin-form</tt> <a href="#rfc.iref.g.83"><b>5.3</b></a></li> 3366 3368 <li><tt>OWS</tt> <a href="#rfc.iref.g.40"><b>3.2.3</b></a></li> 3367 3369 <li><tt>partial-URI</tt> <a href="#rfc.iref.g.25"><b>2.7</b></a></li> 3368 3370 <li><tt>port</tt> <a href="#rfc.iref.g.20"><b>2.7</b></a></li> 3369 <li><tt>protocol-name</tt> <a href="#rfc.iref.g. 89"><b>5.7.1</b></a></li>3370 <li><tt>protocol-version</tt> <a href="#rfc.iref.g.9 0"><b>5.7.1</b></a></li>3371 <li><tt>pseudonym</tt> <a href="#rfc.iref.g.9 2"><b>5.7.1</b></a></li>3371 <li><tt>protocol-name</tt> <a href="#rfc.iref.g.90"><b>5.7.1</b></a></li> 3372 <li><tt>protocol-version</tt> <a href="#rfc.iref.g.91"><b>5.7.1</b></a></li> 3373 <li><tt>pseudonym</tt> <a href="#rfc.iref.g.93"><b>5.7.1</b></a></li> 3372 3374 <li><tt>qdtext</tt> <a href="#rfc.iref.g.48"><b>3.2.6</b></a></li> 3373 3375 <li><tt>qdtext-nf</tt> <a href="#rfc.iref.g.74"><b>4.1</b></a></li> … … 3379 3381 <li><tt>rank</tt> <a href="#rfc.iref.g.80"><b>4.3</b></a></li> 3380 3382 <li><tt>reason-phrase</tt> <a href="#rfc.iref.g.34"><b>3.1.2</b></a></li> 3381 <li><tt>received-by</tt> <a href="#rfc.iref.g.9 1"><b>5.7.1</b></a></li>3382 <li><tt>received-protocol</tt> <a href="#rfc.iref.g.8 8"><b>5.7.1</b></a></li>3383 <li><tt>received-by</tt> <a href="#rfc.iref.g.92"><b>5.7.1</b></a></li> 3384 <li><tt>received-protocol</tt> <a href="#rfc.iref.g.89"><b>5.7.1</b></a></li> 3383 3385 <li><tt>request-line</tt> <a href="#rfc.iref.g.30"><b>3.1.1</b></a></li> 3384 <li><tt>request-target</tt> <a href="#rfc.iref.g.8 1"><b>5.3</b></a></li>3386 <li><tt>request-target</tt> <a href="#rfc.iref.g.82"><b>5.3</b></a></li> 3385 3387 <li><tt>RWS</tt> <a href="#rfc.iref.g.41"><b>3.2.3</b></a></li> 3386 3388 <li><tt>segment</tt> <a href="#rfc.iref.g.23"><b>2.7</b></a></li> … … 3395 3397 <li><tt>TE</tt> <a href="#rfc.iref.g.77"><b>4.3</b></a></li> 3396 3398 <li><tt>token</tt> <a href="#rfc.iref.g.44"><b>3.2.6</b></a></li> 3397 <li><tt>Trailer</tt> <a href="#rfc.iref.g. 75"><b>4.1.1</b></a></li>3398 <li><tt>trailer-part</tt> <a href="#rfc.iref.g.72"> <b>4.1</b></a></li>3399 <li><tt>Trailer</tt> <a href="#rfc.iref.g.81"><b>4.4</b></a></li> 3400 <li><tt>trailer-part</tt> <a href="#rfc.iref.g.72">4.1</a>, <a href="#rfc.iref.g.75"><b>4.1.1</b></a></li> 3399 3401 <li><tt>transfer-coding</tt> <a href="#rfc.iref.g.57"><b>4</b></a></li> 3400 3402 <li><tt>Transfer-Encoding</tt> <a href="#rfc.iref.g.55"><b>3.3.1</b></a></li> 3401 3403 <li><tt>transfer-extension</tt> <a href="#rfc.iref.g.58"><b>4</b></a></li> 3402 3404 <li><tt>transfer-parameter</tt> <a href="#rfc.iref.g.59"><b>4</b></a></li> 3403 <li><tt>Upgrade</tt> <a href="#rfc.iref.g.9 5"><b>6.7</b></a></li>3405 <li><tt>Upgrade</tt> <a href="#rfc.iref.g.96"><b>6.7</b></a></li> 3404 3406 <li><tt>uri-host</tt> <a href="#rfc.iref.g.24"><b>2.7</b></a></li> 3405 3407 <li><tt>URI-reference</tt> <a href="#rfc.iref.g.16"><b>2.7</b></a></li> 3406 3408 <li><tt>value</tt> <a href="#rfc.iref.g.61"><b>4</b></a></li> 3407 3409 <li>VCHAR <a href="#rfc.iref.g.12"><b>1.2</b></a></li> 3408 <li><tt>Via</tt> <a href="#rfc.iref.g.8 7"><b>5.7.1</b></a></li>3410 <li><tt>Via</tt> <a href="#rfc.iref.g.88"><b>5.7.1</b></a></li> 3409 3411 <li><tt>word</tt> <a href="#rfc.iref.g.43"><b>3.2.6</b></a></li> 3410 3412 </ul> … … 3575 3577 <li>target resource <a href="#rfc.iref.t.7"><b>5.1</b></a></li> 3576 3578 <li>target URI <a href="#rfc.iref.t.8"><b>5.1</b></a></li> 3577 <li>TE header field <a href="#rfc.xref.header.te.1">4</a>, <a href="#rfc.xref.header.te.2">4.1.1</a>, <a href="#rfc.iref.t. 6"><b>4.3</b></a>, <a href="#rfc.xref.header.te.3">7.1</a></li>3578 <li>Trailer header field <a href="#rfc.iref.t. 5"><b>4.1.1</b></a>, <a href="#rfc.xref.header.trailer.1">7.1</a></li>3579 <li>TE header field <a href="#rfc.xref.header.te.1">4</a>, <a href="#rfc.xref.header.te.2">4.1.1</a>, <a href="#rfc.iref.t.5"><b>4.3</b></a>, <a href="#rfc.xref.header.te.3">7.1</a></li> 3580 <li>Trailer header field <a href="#rfc.iref.t.6"><b>4.4</b></a>, <a href="#rfc.xref.header.trailer.1">7.1</a></li> 3579 3581 <li>Transfer-Encoding header field <a href="#rfc.xref.header.transfer-encoding.1">3.3</a>, <a href="#rfc.iref.t.4"><b>3.3.1</b></a>, <a href="#rfc.xref.header.transfer-encoding.2">4</a>, <a href="#rfc.xref.header.transfer-encoding.3">7.1</a>, <a href="#rfc.xref.header.transfer-encoding.4">A.1.3</a></li> 3580 3582 <li>transforming proxy <a href="#rfc.iref.t.1"><b>2.3</b></a></li> -
draft-ietf-httpbis/latest/p1-messaging.xml
r2338 r2339 1976 1976 <x:anchor-alias value="chunk-size"/> 1977 1977 <x:anchor-alias value="last-chunk"/> 1978 <x:anchor-alias value="trailer-part"/>1979 1978 <x:anchor-alias value="quoted-str-nf"/> 1980 1979 <x:anchor-alias value="qdtext-nf"/> … … 1987 1986 received the full message. 1988 1987 </t> 1989 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="chunked-body"><!--terminal production--></iref><iref primary="true" item="Grammar" subitem="chunk"/><iref primary="true" item="Grammar" subitem="chunk-size"/><iref primary="true" item="Grammar" subitem="last-chunk"/><iref primary="true" item="Grammar" subitem="chunk-ext"/><iref primary="true" item="Grammar" subitem="chunk-ext-name"/><iref primary="true" item="Grammar" subitem="chunk-ext-val"/><iref primary="true" item="Grammar" subitem="chunk-data"/><iref primary=" true" item="Grammar" subitem="trailer-part"/><iref primary="true" item="Grammar" subitem="quoted-str-nf"/><iref primary="true" item="Grammar" subitem="qdtext-nf"/>1988 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="chunked-body"><!--terminal production--></iref><iref primary="true" item="Grammar" subitem="chunk"/><iref primary="true" item="Grammar" subitem="chunk-size"/><iref primary="true" item="Grammar" subitem="last-chunk"/><iref primary="true" item="Grammar" subitem="chunk-ext"/><iref primary="true" item="Grammar" subitem="chunk-ext-name"/><iref primary="true" item="Grammar" subitem="chunk-ext-val"/><iref primary="true" item="Grammar" subitem="chunk-data"/><iref primary="false" item="Grammar" subitem="trailer-part"/><iref primary="true" item="Grammar" subitem="quoted-str-nf"/><iref primary="true" item="Grammar" subitem="qdtext-nf"/> 1990 1989 <x:ref>chunked-body</x:ref> = *<x:ref>chunk</x:ref> 1991 1990 <x:ref>last-chunk</x:ref> … … 2002 2001 <x:ref>chunk-ext-val</x:ref> = <x:ref>token</x:ref> / <x:ref>quoted-str-nf</x:ref> 2003 2002 <x:ref>chunk-data</x:ref> = 1*<x:ref>OCTET</x:ref> ; a sequence of chunk-size octets 2004 <x:ref>trailer-part</x:ref> = *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> )2005 2003 2006 2004 <x:ref>quoted-str-nf</x:ref> = <x:ref>DQUOTE</x:ref> *( <x:ref>qdtext-nf</x:ref> / <x:ref>quoted-pair</x:ref> ) <x:ref>DQUOTE</x:ref> … … 2020 2018 </t> 2021 2019 2022 <section title="Trailer" anchor="header.trailer"> 2023 <iref primary="true" item="Trailer header field" x:for-anchor=""/> 2024 <x:anchor-alias value="Trailer"/> 2020 <section title="Chunked Trailer Part" anchor="chunked.trailer.part"> 2021 <x:anchor-alias value="trailer-part"/> 2025 2022 <t> 2026 2023 A trailer allows the sender to include additional fields at the end of a … … 2031 2028 instead of the message header block. 2032 2029 </t> 2033 <t> 2034 When a message includes a message body encoded with the chunked 2035 transfer coding and the sender desires to send metadata in the form of 2036 trailer fields at the end of the message, the sender &SHOULD; generate a 2037 <x:ref>Trailer</x:ref> header field before the message body to indicate 2038 which fields will be present in the trailers. This allows the recipient 2039 to prepare for receipt of that metadata before it starts processing the body, 2040 which is useful if the message is being streamed and the recipient wishes 2041 to confirm an integrity check on the fly. 2042 </t> 2043 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Trailer"/> 2044 <x:ref>Trailer</x:ref> = 1#<x:ref>field-name</x:ref> 2030 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="trailer-part"/> 2031 <x:ref>trailer-part</x:ref> = *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> ) 2045 2032 </artwork></figure> 2046 2033 <t> … … 2080 2067 </section> 2081 2068 2082 <section title="Decoding chunked" anchor="decoding.chunked">2069 <section title="Decoding Chunked" anchor="decoding.chunked"> 2083 2070 <t> 2084 2071 A process for decoding the chunked transfer coding … … 2191 2178 The presence of the keyword "trailers" indicates that the client is willing 2192 2179 to accept trailer fields in a chunked transfer coding, as defined in 2193 <xref target="chunked. encoding"/>, on behalf of itself and any downstream2180 <xref target="chunked.trailer.part"/>, on behalf of itself and any downstream 2194 2181 clients. For requests from an intermediary, this implies that either: 2195 2182 (a) all downstream clients are willing to accept trailer fields in the … … 2220 2207 that do not support its semantics. 2221 2208 </t> 2209 </section> 2210 2211 <section title="Trailer" anchor="header.trailer"> 2212 <iref primary="true" item="Trailer header field" x:for-anchor=""/> 2213 <x:anchor-alias value="Trailer"/> 2214 <t> 2215 When a message includes a message body encoded with the chunked 2216 transfer coding and the sender desires to send metadata in the form of 2217 trailer fields at the end of the message, the sender &SHOULD; generate a 2218 <x:ref>Trailer</x:ref> header field before the message body to indicate 2219 which fields will be present in the trailers. This allows the recipient 2220 to prepare for receipt of that metadata before it starts processing the body, 2221 which is useful if the message is being streamed and the recipient wishes 2222 to confirm an integrity check on the fly. 2223 </t> 2224 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Trailer"/> 2225 <x:ref>Trailer</x:ref> = 1#<x:ref>field-name</x:ref> 2226 </artwork></figure> 2222 2227 </section> 2223 2228 </section>
Note: See TracChangeset
for help on using the changeset viewer.