Changeset 2270 for draft-ietf-httpbis/latest/p1-messaging.html
- Timestamp:
- 21/05/13 22:00:59 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/p1-messaging.html
r2269 r2270 855 855 or provide adequate warning for security or privacy options. In the few cases where this specification requires reporting 856 856 of errors to the user, it is acceptable for such reporting to only be observable in an error console or log file. Likewise, 857 requirements that an automated action be confirmed by the user before proceeding can be met via advance configuration choices, 858 run-time options, or simply not proceeding with the unsafe action. 857 requirements that an automated action be confirmed by the user before proceeding might be met via advance configuration choices, 858 run-time options, or simple avoidance of the unsafe action; confirmation does not imply any specific user interface or interruption 859 of normal processing if the user has already made that choice. 859 860 </p> 860 861 <div id="rfc.iref.i.1"></div> … … 872 873 the chain. Although the diagram is linear, each participant might be engaged in multiple, simultaneous communications. For 873 874 example, B might be receiving requests from many clients other than A, and/or forwarding requests to servers other than C, 874 at the same time that it is handling A's request. 875 at the same time that it is handling A's request. Likewise, later requests might be sent through a different path of connections, 876 often based on dynamic configuration for load balancing. 875 877 </p> 876 878 <p id="rfc.section.2.3.p.4"> <span id="rfc.iref.u.2"></span><span id="rfc.iref.d.1"></span> <span id="rfc.iref.i.2"></span><span id="rfc.iref.o.2"></span> We use the terms "<dfn>upstream</dfn>" and "<dfn>downstream</dfn>" to describe various requirements in relation to the directional flow of a message: all messages flow from upstream to downstream. … … 891 893 a given message, we use the term "<dfn>non-transforming proxy</dfn>" to target requirements that preserve HTTP message semantics. See <a href="p2-semantics.html#status.203" title="203 Non-Authoritative Information">Section 6.3.4</a> of <a href="#Part2" id="rfc.xref.Part2.3"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a> and <a href="p6-cache.html#header.warning" title="Warning">Section 7.5</a> of <a href="#Part6" id="rfc.xref.Part6.2"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Caching">[Part6]</cite></a> for status and warning codes related to transformations. 892 894 </p> 893 <p id="rfc.section.2.3.p.7"><span id="rfc.iref.g.13"></span><span id="rfc.iref.r.4"></span> <span id="rfc.iref.a.1"></span> A "<dfn>gateway</dfn>" (a.k.a., "<dfn>reverse proxy</dfn>") is a receiving agent that acts as a layer above some other server(s) and translates the received requests to the underlying 894 server's protocol. Gateways are often used to encapsulate legacy or untrusted information services, to improve server performance 895 through "<dfn>accelerator</dfn>" caching, and to enable partitioning or load-balancing of HTTP services across multiple machines. 896 </p> 897 <p id="rfc.section.2.3.p.8">A gateway behaves as an origin server on its outbound connection and as a user agent on its inbound connection. All HTTP requirements 898 applicable to an origin server also apply to the outbound communication of a gateway. A gateway communicates with inbound 899 servers using any protocol that it desires, including private extensions to HTTP that are outside the scope of this specification. 900 However, an HTTP-to-HTTP gateway that wishes to interoperate with third-party HTTP servers <em class="bcp14">MUST</em> conform to HTTP user agent requirements on the gateway's inbound connection and <em class="bcp14">MUST</em> implement the <a href="#header.connection" class="smpl">Connection</a> (<a href="#header.connection" id="rfc.xref.header.connection.1" title="Connection">Section 6.1</a>) and <a href="#header.via" class="smpl">Via</a> (<a href="#header.via" id="rfc.xref.header.via.1" title="Via">Section 5.7.1</a>) header fields for both connections. 895 <p id="rfc.section.2.3.p.7"><span id="rfc.iref.g.13"></span><span id="rfc.iref.r.4"></span> <span id="rfc.iref.a.1"></span> A "<dfn>gateway</dfn>" (a.k.a., "<dfn>reverse proxy</dfn>") is an intermediary that acts as an origin server for the outbound connection, but translates received requests and forwards 896 them inbound to another server or servers. Gateways are often used to encapsulate legacy or untrusted information services, 897 to improve server performance through "<dfn>accelerator</dfn>" caching, and to enable partitioning or load balancing of HTTP services across multiple machines. 898 </p> 899 <p id="rfc.section.2.3.p.8">All HTTP requirements applicable to an origin server also apply to the outbound communication of a gateway. A gateway communicates 900 with inbound servers using any protocol that it desires, including private extensions to HTTP that are outside the scope of 901 this specification. However, an HTTP-to-HTTP gateway that wishes to interoperate with third-party HTTP servers <em class="bcp14">MUST</em> conform to HTTP user agent requirements on the gateway's inbound connection and <em class="bcp14">MUST</em> implement the <a href="#header.connection" class="smpl">Connection</a> (<a href="#header.connection" id="rfc.xref.header.connection.1" title="Connection">Section 6.1</a>) and <a href="#header.via" class="smpl">Via</a> (<a href="#header.via" id="rfc.xref.header.via.1" title="Via">Section 5.7.1</a>) header fields for both inbound and outbound connections. 901 902 </p> 902 903 <p id="rfc.section.2.3.p.9"><span id="rfc.iref.t.2"></span> A "<dfn>tunnel</dfn>" acts as a blind relay between two connections without changing the messages. Once active, a tunnel is not considered a party … … 1669 1670 TE: trailers, deflate;q=0.5 1670 1671 </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 1671 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 chained requests, this implies that either: (a) all downstream clients1672 are willing to accept trailer fields in the forwarded response; or, (b) the client will attempt to buffer the response on1673 behalf of downstream recipients. Note that HTTP/1.1 does not define any means to limit the size of a chunked response such1674 that a clientcan be assured of buffering the entire response.1672 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 downstream 1673 clients are willing to accept trailer fields in the forwarded response; or, (b) the intermediary will attempt to buffer the 1674 response on behalf of downstream recipients. Note that HTTP/1.1 does not define any means to limit the size of a chunked response 1675 such that an intermediary can be assured of buffering the entire response. 1675 1676 </p> 1676 1677 <p id="rfc.section.4.3.p.7">When multiple transfer codings are acceptable, the client <em class="bcp14">MAY</em> rank the codings by preference using a case-insensitive "q" parameter (similar to the qvalues used in content negotiation … … 1703 1704 semantics and, if so, where that request is to be directed. 1704 1705 </p> 1705 <p id="rfc.section.5.2.p.2">If the client has a response cache and the request semantics can be satisfied by a cache (<a href="#Part6" id="rfc.xref.Part6.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Caching">[Part6]</cite></a>), then the request is usually directed to the cache first.1706 <p id="rfc.section.5.2.p.2">If the client has a cache <a href="#Part6" id="rfc.xref.Part6.5"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Caching">[Part6]</cite></a> and the request can be satisfied by it, then the request is usually directed there first. 1706 1707 </p> 1707 1708 <p id="rfc.section.5.2.p.3">If the request is not satisfied by a cache, then a typical client will check its configuration to determine whether a proxy … … 1922 1923 selected representation. A proxy <em class="bcp14">MAY</em> change the message body through application or removal of a transfer coding (<a href="#transfer.codings" title="Transfer Codings">Section 4</a>). 1923 1924 </p> 1924 <p id="rfc.section.5.7.2.p.5">A non-transforming proxy <em class="bcp14">MUST </em> preserve the message payload (<a href="p2-semantics.html#payload" title="Payload Semantics">Section 3.3</a> of <a href="#Part2" id="rfc.xref.Part2.22"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a>). A transforming proxy <em class="bcp14">MUST</em> preservethe payload of a message that contains the no-transform cache-control directive.1925 <p id="rfc.section.5.7.2.p.5">A non-transforming proxy <em class="bcp14">MUST NOT</em> modify the message payload (<a href="p2-semantics.html#payload" title="Payload Semantics">Section 3.3</a> of <a href="#Part2" id="rfc.xref.Part2.22"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a>). A transforming proxy <em class="bcp14">MUST NOT</em> modify the payload of a message that contains the no-transform cache-control directive. 1925 1926 </p> 1926 1927 <p id="rfc.section.5.7.2.p.6">A transforming proxy <em class="bcp14">MAY</em> transform the payload of a message that does not contain the no-transform cache-control directive; if the payload is transformed, … … 2115 2116 <a href="#header.upgrade" class="smpl">protocol-name</a> = <a href="#rule.token.separators" class="smpl">token</a> 2116 2117 <a href="#header.upgrade" class="smpl">protocol-version</a> = <a href="#rule.token.separators" class="smpl">token</a> 2117 </pre><p id="rfc.section.6.7.p.3">For example,</p> 2118 <div id="rfc.figure.u.58"></div><pre class="text"> Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11 2119 </pre><p id="rfc.section.6.7.p.5">Upgrade eases the difficult transition between incompatible protocols by allowing the client to initiate a request in the 2118 </pre><div id="rfc.figure.u.58"></div> 2119 <p>The following is a hypothetical example sent by a client:</p><pre class="text2">GET /hello.txt HTTP/1.1 2120 Host: www.example.com 2121 Connection: upgrade 2122 Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11 2123 2124 </pre><p id="rfc.section.6.7.p.4">Upgrade eases the difficult transition between incompatible protocols by allowing the client to initiate a request in the 2120 2125 more commonly supported protocol while indicating to the server that it would like to use a "better" protocol if available 2121 2126 (where "better" is determined by the server, possibly according to the nature of the request method or target resource). 2122 2127 </p> 2123 <p id="rfc.section.6.7.p. 6">Upgrade cannot be used to insist on a protocol change; its acceptance and use by the server is optional. The capabilities2128 <p id="rfc.section.6.7.p.5">Upgrade cannot be used to insist on a protocol change; its acceptance and use by the server is optional. The capabilities 2124 2129 and nature of the application-level communication after the protocol change is entirely dependent upon the new protocol chosen, 2125 2130 although the first action after changing the protocol <em class="bcp14">MUST</em> be a response to the initial HTTP request that contained the Upgrade header field. 2126 2131 </p> 2127 <p id="rfc.section.6.7.p. 7">For example, if the Upgrade header field is received in a GET request and the server decides to switch protocols, then it2132 <p id="rfc.section.6.7.p.6">For example, if the Upgrade header field is received in a GET request and the server decides to switch protocols, then it 2128 2133 first responds with a <a href="p2-semantics.html#status.101" class="smpl">101 (Switching Protocols)</a> message in HTTP/1.1 and then immediately follows that with the new protocol's equivalent of a response to a GET on the target 2129 2134 resource. This allows a connection to be upgraded to protocols with the same semantics as HTTP without the latency cost of … … 2131 2136 by any protocol. 2132 2137 </p> 2133 <p id="rfc.section.6.7.p.8">When Upgrade is sent, a sender <em class="bcp14">MUST</em> also send a <a href="#header.connection" class="smpl">Connection</a> header field (<a href="#header.connection" id="rfc.xref.header.connection.7" title="Connection">Section 6.1</a>) that contains the "upgrade" connection option, in order to prevent Upgrade from being accidentally forwarded by intermediaries 2138 <div id="rfc.figure.u.59"></div> 2139 <p>The following is an example response to the above hypothetical request:</p><pre class="text">HTTP/1.1 101 Switching Protocols 2140 Connection: upgrade 2141 Upgrade: HTTP/2.0 2142 2143 [... data stream switches to HTTP/2.0 with an appropriate response 2144 (as defined by new protocol) to the "GET /hello.txt" request ...] 2145 </pre><p id="rfc.section.6.7.p.8">When Upgrade is sent, a sender <em class="bcp14">MUST</em> also send a <a href="#header.connection" class="smpl">Connection</a> header field (<a href="#header.connection" id="rfc.xref.header.connection.7" title="Connection">Section 6.1</a>) that contains the "upgrade" connection option, in order to prevent Upgrade from being accidentally forwarded by intermediaries 2134 2146 that might not implement the listed protocols. A server <em class="bcp14">MUST</em> ignore an Upgrade header field that is received in an HTTP/1.0 request. 2135 2147 </p> … … 2528 2540 that most implementations will choose substantially higher limits. 2529 2541 </p> 2530 <p id="rfc.section.8.3.p.3">This specification also provides a way for servers to reject messages that have request-targets that are too long (<a href="p2-semantics.html#status.414" title="414 URI Too Long">Section 6.5.12</a> of <a href="#Part2" id="rfc.xref.Part2.28"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a>) or request entities that are too large (<a href="p2-semantics.html#status.4xx" title="Client Error 4xx">Section 6.5</a> of <a href="#Part2" id="rfc.xref.Part2.29"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a>). 2542 <p id="rfc.section.8.3.p.3">This specification also provides a way for servers to reject messages that have request-targets that are too long (<a href="p2-semantics.html#status.414" title="414 URI Too Long">Section 6.5.12</a> of <a href="#Part2" id="rfc.xref.Part2.28"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a>) or request entities that are too large (<a href="p2-semantics.html#status.4xx" title="Client Error 4xx">Section 6.5</a> of <a href="#Part2" id="rfc.xref.Part2.29"><cite title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">[Part2]</cite></a>). Additional status codes related to capacity limits have been defined by extensions to HTTP <a href="#RFC6585" id="rfc.xref.RFC6585.1"><cite title="Additional HTTP Status Codes">[RFC6585]</cite></a>. 2531 2543 </p> 2532 2544 <p id="rfc.section.8.3.p.4">Recipients <em class="bcp14">SHOULD</em> carefully limit the extent to which they read other fields, including (but not limited to) request methods, response status … … 2784 2796 </td> 2785 2797 </tr> 2798 <tr> 2799 <td class="reference"><b id="RFC6585">[RFC6585]</b></td> 2800 <td class="top">Nottingham, M. and R. Fielding, “<a href="http://tools.ietf.org/html/rfc6585">Additional HTTP Status Codes</a>”, RFC 6585, April 2012. 2801 </td> 2802 </tr> 2786 2803 </table> 2787 2804 <div class="avoidbreak"> … … 2939 2956 indicating at least <n> and at most <m> elements, each separated by a single comma (",") and optional whitespace (OWS). 2940 2957 </p> 2941 <div id="rfc.figure.u. 59"></div>2958 <div id="rfc.figure.u.60"></div> 2942 2959 <p>Thus,</p><pre class="text"> 1#element => element *( OWS "," OWS element ) 2943 </pre><div id="rfc.figure.u.6 0"></div>2960 </pre><div id="rfc.figure.u.61"></div> 2944 2961 <p>and:</p><pre class="text"> #element => [ 1#element ] 2945 </pre><div id="rfc.figure.u.6 1"></div>2962 </pre><div id="rfc.figure.u.62"></div> 2946 2963 <p>and for n >= 1 and m > 1:</p><pre class="text"> <n>#<m>element => element <n-1>*<m-1>( OWS "," OWS element ) 2947 2964 </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: 2948 2965 </p> 2949 <div id="rfc.figure.u.6 2"></div><pre class="text"> #element => [ ( "," / element ) *( OWS "," [ OWS element ] ) ]2966 <div id="rfc.figure.u.63"></div><pre class="text"> #element => [ ( "," / element ) *( OWS "," [ OWS element ] ) ] 2950 2967 2951 2968 1#element => *( "," OWS ) element *( OWS "," [ OWS element ] ) 2952 2969 </pre><p id="rfc.section.B.p.8">Note that empty elements do not contribute to the count of elements present, though.</p> 2953 2970 <p id="rfc.section.B.p.9">For example, given these ABNF productions:</p> 2954 <div id="rfc.figure.u.6 3"></div><pre class="text"> example-list = 1#example-list-elmt2971 <div id="rfc.figure.u.64"></div><pre class="text"> example-list = 1#example-list-elmt 2955 2972 example-list-elmt = token ; see <a href="#field.components" title="Field value components">Section 3.2.6</a> 2956 2973 </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> 2957 <div id="rfc.figure.u.6 4"></div><pre class="text"> "foo,bar"2974 <div id="rfc.figure.u.65"></div><pre class="text"> "foo,bar" 2958 2975 "foo ,bar," 2959 2976 "foo , ,bar,charlie " 2960 2977 </pre><p id="rfc.section.B.p.13">But these values would be invalid, as at least one non-empty element is required:</p> 2961 <div id="rfc.figure.u.6 5"></div><pre class="text"> ""2978 <div id="rfc.figure.u.66"></div><pre class="text"> "" 2962 2979 "," 2963 2980 ", ," … … 2965 2982 </p> 2966 2983 <h1 id="rfc.section.C"><a href="#rfc.section.C">C.</a> <a id="collected.abnf" href="#collected.abnf">Collected ABNF</a></h1> 2967 <div id="rfc.figure.u.6 6"></div><pre class="inline"><a href="#rule.whitespace" class="smpl">BWS</a> = OWS2984 <div id="rfc.figure.u.67"></div><pre class="inline"><a href="#rule.whitespace" class="smpl">BWS</a> = OWS 2968 2985 2969 2986 <a href="#header.connection" class="smpl">Connection</a> = *( "," OWS ) connection-option *( OWS "," [ OWS … … 3442 3459 </li> 3443 3460 <li><em>RFC6265</em> <a href="#rfc.xref.RFC6265.1">2.7.2</a>, <a href="#rfc.xref.RFC6265.2">3.2.2</a>, <a href="#RFC6265"><b>10.2</b></a></li> 3461 <li><em>RFC6585</em> <a href="#rfc.xref.RFC6585.1">8.3</a>, <a href="#RFC6585"><b>10.2</b></a></li> 3444 3462 </ul> 3445 3463 </li>
Note: See TracChangeset
for help on using the changeset viewer.