Changeset 852
- Timestamp:
- Jul 16, 2010, 10:56:53 PM (9 years ago)
- Location:
- draft-ietf-httpbis/latest
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
draft-ietf-httpbis/latest/p1-messaging.xml
r849 r852 16 16 <!ENTITY ID-YEAR "2010"> 17 17 <!ENTITY caching-overview "<xref target='Part6' x:rel='#caching.overview' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 18 <!ENTITY cache-incomplete "<xref target='Part6' x:rel='#errors.or.incomplete.response.cache.behavior' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 18 19 <!ENTITY payload "<xref target='Part3' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 19 20 <!ENTITY media-types "<xref target='Part3' x:rel='#media.types' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> … … 21 22 <!ENTITY CONNECT "<xref target='Part2' x:rel='#CONNECT' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 22 23 <!ENTITY content.negotiation "<xref target='Part3' x:rel='#content.negotiation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 23 <!ENTITY diff 2045entity"<xref target='Part3' x:rel='#differences.between.http.entities.and.rfc.2045.entities' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">24 <!ENTITY diff-mime "<xref target='Part3' x:rel='#differences.between.http.entities.and.rfc.2045.entities' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 24 25 <!ENTITY entity "<xref target='Part3' x:rel='#entity' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 25 <!ENTITY entity-body "<xref target='Part3' x:rel='#entity.body' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">26 26 <!ENTITY entity-header-fields "<xref target='Part3' x:rel='#entity.header.fields' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 27 <!ENTITY entity-length "<xref target='Part3' x:rel='#entity.length' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">28 27 <!ENTITY header-cache-control "<xref target='Part6' x:rel='#header.cache-control' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 29 28 <!ENTITY header-expect "<xref target='Part2' x:rel='#header.expect' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> … … 236 235 Messages are passed in a format similar to that used by Internet mail 237 236 <xref target="RFC5322"/> and the Multipurpose Internet Mail Extensions 238 (MIME) <xref target="RFC2045"/> (see &diff 2045entity; for the differences237 (MIME) <xref target="RFC2045"/> (see &diff-mime; for the differences 239 238 between HTTP and MIME messages). 240 239 </t> … … 421 420 <x:anchor-alias value="CRLF"/> 422 421 HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all 423 protocol elements except the entity-body (see <xref target="tolerant.applications"/> for 424 tolerant applications). The end-of-line marker within an entity-body 425 is defined by its associated media type, as described in &media-types;. 422 protocol elements other than the message-body 423 (see <xref target="tolerant.applications"/> for tolerant applications). 426 424 </t> 427 425 <t anchor="rule.LWS"> … … 522 520 <x:anchor-alias value="request-header"/> 523 521 <x:anchor-alias value="response-header"/> 524 <x:anchor-alias value="entity-body"/>525 522 <x:anchor-alias value="entity-header"/> 526 523 <x:anchor-alias value="Cache-Control"/> … … 535 532 </artwork></figure> 536 533 <figure><!-- Part3--><artwork type="abnf2616"> 537 <x:ref>entity-body</x:ref> = <entity-body, defined in &entity-body;>538 534 <x:ref>entity-header</x:ref> = <entity-header, defined in &entity-header-fields;> 539 535 </artwork></figure> … … 1058 1054 differ only in the start-line, which is either a Request-Line (for requests) 1059 1055 or a Status-Line (for responses), and in the algorithm for determining 1060 the length of the message-body (<xref target="message. length"/>).1056 the length of the message-body (<xref target="message.body.length"/>). 1061 1057 In theory, a client could receive requests and a server could receive 1062 1058 responses, distinguishing them by their different start-line formats, … … 1105 1101 data to determine if a message-body is expected. If a message-body 1106 1102 has been indicated, then it is read as a stream until an amount 1107 of OCTETs equal to the message-length is read or the connection1103 of octets equal to the message-body length is read or the connection 1108 1104 is closed. Care must be taken to parse an HTTP message as a sequence 1109 of OCTETs in an encoding that is a superset of US-ASCII. Attempting1105 of octets in an encoding that is a superset of US-ASCII. Attempting 1110 1106 to parse HTTP as a stream of Unicode characters in a character encoding 1111 1107 like UTF-16 may introduce security flaws due to the differing ways … … 1233 1229 <t> 1234 1230 The message-body (if any) of an HTTP message is used to carry the 1235 entity-body associated with the request or response. The message-body1236 differs from the entity-body only when a transfer-coding has been1231 payload body associated with the request or response. The message-body 1232 differs from the payload body only when a transfer-coding has been 1237 1233 applied, as indicated by the Transfer-Encoding header field (<xref target="header.transfer-encoding"/>). 1238 1234 </t> 1239 1235 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="message-body"/> 1240 <x:ref>message-body</x:ref> = <x:ref>entity-body</x:ref>1241 / <entity-body encoded as per <x:ref>Transfer-Encoding</x:ref>> 1242 < /artwork></figure>1243 <t> 1244 Transfer-Encoding &MUST; be used to indicate any transfer-codings1245 applied by an application to ensure safe and proper transfer of the1246 message. Transfer-Encoding is a property of the message, not of the1247 entity, and thus &MAY; be added or removed by any application along the1248 request/response chain. (However, <xref target="transfer.codings"/> places restrictions on1249 when certain transfer-codings may be used.)1236 <x:ref>message-body</x:ref> = *OCTET 1237 </artwork></figure> 1238 <t> 1239 When one or more transfer-codings are applied to a payload body, 1240 usually for the sake of stream-delimiting or data compression, the 1241 Transfer-Encoding header field &MUST; be provided with the list of 1242 transfer-codings applied. Transfer-Encoding is a property of the message, 1243 not of the payload, and thus &MAY; be added or removed by any implementation 1244 along the request/response chain under the constraints found in 1245 <xref target="transfer.codings"/>. 1250 1246 </t> 1251 1247 <t> … … 1256 1252 The presence of a message-body in a request is signaled by the 1257 1253 inclusion of a Content-Length or Transfer-Encoding header field in 1258 the request's header fields. 1259 When a request message contains both a message-body of non-zero 1260 length and a method that does not define any semantics for that 1261 request message-body, then an origin server &SHOULD; either ignore 1262 the message-body or respond with an appropriate error message 1263 (e.g., 413). A proxy or gateway, when presented the same request, 1264 &SHOULD; either forward the request inbound with the message-body or 1265 ignore the message-body when determining a response. 1254 the request's header fields, even if the request method does not 1255 define any use for a message-body. This allows the request 1256 message framing algorithm to be independent of method semantics. 1257 A server &MUST; read the entire request message-body or close 1258 the connection after sending its response. 1266 1259 </t> 1267 1260 <t> 1268 1261 For response messages, whether or not a message-body is included with 1269 1262 a message is dependent on both the request method and the response 1270 status code (<xref target="status.code.and.reason.phrase"/>). All responses to the HEAD request method 1271 &MUST-NOT; include a message-body, even though the presence of entity-header 1272 fields might lead one to believe they do. All 1xx 1273 (Informational), 204 (No Content), and 304 (Not Modified) responses 1274 &MUST-NOT; include a message-body. All other responses do include a 1275 message-body, although it &MAY; be of zero length. 1276 </t> 1277 </section> 1278 1279 <section title="Message Length" anchor="message.length"> 1280 <t> 1281 The transfer-length of a message is the length of the message-body as 1282 it appears in the message; that is, after any transfer-codings have 1283 been applied. When a message-body is included with a message, the 1284 transfer-length of that body is determined by one of the following 1263 status code (<xref target="status.code.and.reason.phrase"/>). 1264 Responses to the HEAD request method never include a message-body 1265 because the associated response header fields (e.g., Transfer-Encoding, 1266 Content-Length, etc.) only indicate what their values would have been 1267 if the method had been GET. All 1xx (Informational), 204 (No Content), 1268 and 304 (Not Modified) responses &MUST-NOT; include a message-body. 1269 All other responses do include a message-body, although the body 1270 &MAY; be of zero length. 1271 </t> 1272 <t anchor="message.body.length"> 1273 The length of the message-body is determined by one of the following 1285 1274 (in order of precedence): 1286 1275 </t> … … 1288 1277 <list style="numbers"> 1289 1278 <x:lt><t> 1290 Any response message which "&MUST-NOT;" include a message-body (such 1291 as the 1xx, 204, and 304 responses and any response to a HEAD 1292 request) is always terminated by the first empty line after the 1293 header fields, regardless of the entity-header fields present in 1294 the message. 1279 Any response to a HEAD request and any response with a status 1280 code of 100-199, 204, or 304 is always terminated by the first 1281 empty line after the header fields, regardless of the header 1282 fields present in the message, and thus cannot contain a message-body. 1295 1283 </t></x:lt> 1296 1284 <x:lt><t> 1297 1285 If a Transfer-Encoding header field (<xref target="header.transfer-encoding"/>) 1298 1286 is present and the "chunked" transfer-coding (<xref target="transfer.codings"/>) 1299 is used, the transfer-length is defined by the use of this transfer-coding. 1300 If a Transfer-Encoding header field is present and the "chunked" transfer-coding 1301 is not present, the transfer-length is defined by the sender closing the connection. 1287 is used, the message-body length is determined by reading and decoding the 1288 chunked data until the transfer-coding indicates the data is complete. 1289 </t> 1290 <t> 1291 If a message is received with both a Transfer-Encoding header field and a 1292 Content-Length header field, the Transfer-Encoding overrides the Content-Length. 1293 Such a message may indicate an attempt to perform request or response 1294 smuggling (bypass of security-related checks on message routing or content) 1295 and thus should be handled as an error. The provided Content-Length &MUST; 1296 be removed, prior to forwarding the message downstream, or replaced with 1297 the real message-body length after the transfer-coding is decoded. 1298 </t> 1299 <t> 1300 If a Transfer-Encoding header field is present in a response and the 1301 "chunked" transfer-coding is not present, the message-body length is 1302 determined by reading the connection until it is closed. 1303 If a Transfer-Encoding header field is present in a request and the 1304 "chunked" transfer-coding is not present, the message-body length cannot 1305 be determined reliably; the server &MUST; respond with 400 (Bad Request) 1306 and then close the connection. 1302 1307 </t></x:lt> 1303 1308 <x:lt><t> 1304 If a Content-Length header field (<xref target="header.content-length"/>) is present, its 1305 value in OCTETs represents both the entity-length and the 1306 transfer-length. The Content-Length header field &MUST-NOT; be sent 1307 if these two lengths are different (i.e., if a Transfer-Encoding 1308 header field is present). If a message is received with both a 1309 Transfer-Encoding header field and a Content-Length header field, 1310 the latter &MUST; be ignored. 1309 If a valid Content-Length header field (<xref target="header.content-length"/>) 1310 is present without Transfer-Encoding, its decimal value in octets defines 1311 the message-body length. If the actual number of octets sent in the message 1312 is less than the indicated Content-Length, the recipient &MUST; consider 1313 the message to be incomplete and treat the connection as no longer usable. 1314 If the actual number of octets sent in the message is less than the indicated 1315 Content-Length, the recipient &MUST; only process the message-body up to the 1316 field value's number of octets; the remainder of the message &MUST; either 1317 be discarded or treated as the next message in a pipeline. For the sake of 1318 robustness, a user-agent &MAY; attempt to detect and correct such an error 1319 in message framing if it is parsing the response to the last request on 1320 on a connection and the connection has been closed by the server. 1321 </t> 1322 <t> 1323 If a message is received with multiple Content-Length header fields or a 1324 Content-Length header field with an invalid value, the message framing 1325 is invalid and &MUST; be treated as an error to prevent request or 1326 response smuggling. 1327 If this is a request message, the server &MUST; respond with 1328 a 400 (Bad Request) status and then close the connection. 1329 If this is a response message received by a proxy or gateway, the proxy 1330 or gateway &MUST; discard the received response, send a 502 (Bad Gateway) 1331 status as its downstream response, and then close the connection. 1332 If this is a response message received by a user-agent, the message-body 1333 length is determined by reading the connection until it is closed; 1334 an error &SHOULD; be indicated to the user. 1311 1335 </t></x:lt> 1312 1336 <x:lt><t> 1313 If the message uses the media type "multipart/byteranges", and the 1314 transfer-length is not otherwise specified, then this self-delimiting 1315 media type defines the transfer-length. This media type 1316 &MUST-NOT; be used unless the sender knows that the recipient can parse 1317 it; the presence in a request of a Range header with multiple byte-range 1318 specifiers from a HTTP/1.1 client implies that the client can parse 1319 multipart/byteranges responses. 1320 <list style="empty"><t> 1321 A range header might be forwarded by a HTTP/1.0 proxy that does not 1322 understand multipart/byteranges; in this case the server &MUST; 1323 delimit the message using methods defined in items 1, 3 or 5 of 1324 this section. 1325 </t></list> 1337 If this is a request message and none of the above are true, then the 1338 message-body length is zero (no message-body is present). 1326 1339 </t></x:lt> 1327 1340 <x:lt><t> 1328 By the server closing the connection. (Closing the connection1329 cannot be used to indicate the end of a request body, since that1330 would leave no possibility for the server to send back a response.)1341 Otherwise, this is a response message without a declared message-body 1342 length, so the message-body length is determined by the number of octets 1343 received prior to the server closing the connection. 1331 1344 </t></x:lt> 1332 1345 </list> 1333 1346 </t> 1334 1347 <t> 1335 For compatibility with HTTP/1.0 applications, HTTP/1.1 requests 1336 containing a message-body &MUST; include a valid Content-Length header 1337 field unless the server is known to be HTTP/1.1 compliant. If a 1338 request contains a message-body and a Content-Length is not given, 1339 the server &SHOULD; respond with 400 (Bad Request) if it cannot 1340 determine the length of the message, or with 411 (Length Required) if 1341 it wishes to insist on receiving a valid Content-Length. 1342 </t> 1343 <t> 1344 All HTTP/1.1 applications that receive entities &MUST; accept the 1345 "chunked" transfer-coding (<xref target="transfer.codings"/>), thus allowing this mechanism 1346 to be used for messages when the message length cannot be determined 1347 in advance. 1348 </t> 1349 <t> 1350 Messages &MUST-NOT; include both a Content-Length header field and a 1351 transfer-coding. If the message does include a 1352 transfer-coding, the Content-Length &MUST; be ignored. 1353 </t> 1354 <t> 1355 When a Content-Length is given in a message where a message-body is 1356 allowed, its field value &MUST; exactly match the number of OCTETs in 1357 the message-body. HTTP/1.1 user agents &MUST; notify the user when an 1358 invalid length is received and detected. 1348 Since there is no way to distinguish a successfully completed, 1349 close-delimited message from a partially-received message interrupted 1350 by network failure, implementations &SHOULD; use encoding or 1351 length-delimited messages whenever possible. The close-delimiting 1352 feature exists primarily for backwards compatibility with HTTP/1.0. 1353 </t> 1354 <t> 1355 A server &MAY; reject a request that contains a message-body but 1356 not a Content-Length by responding with 411 (Length Required). 1357 </t> 1358 <t> 1359 A client that sends a request containing a message-body &SHOULD; 1360 include a valid Content-Length header field if the message-body length 1361 is known in advance, since many existing services will otherwise respond 1362 with a 411 (Length Required) status code though they can handle the 1363 chunked encoding. This is typically because such services are 1364 implemented via a gateway that requires a content-length in 1365 advance of being called and the server is unable or unwilling 1366 to buffer the entire request before processing. 1367 </t> 1368 <t> 1369 A client that sends a request containing a message-body &MUST; include a 1370 valid Content-Length header field if it does not know the server will 1371 handle HTTP/1.1 (or later) requests; such knowledge can be in the form 1372 of specific user configuration or by remembering the version of a prior 1373 received response. 1374 </t> 1375 <t> 1376 Request messages that are prematurely terminated, possibly due to a 1377 cancelled connection or a server-imposed time-out exception, &MUST; 1378 result in closure of the connection; sending an HTTP/1.1 error response 1379 prior to closing the connection is &OPTIONAL;. 1380 Response messages that are prematurely terminated, usually by closure 1381 of the connection prior to receiving the given number of octets or by 1382 failure to decode a transfer-encoded message-body, &MUST; be recorded 1383 as incomplete. A user agent &MUST-NOT; render an incomplete response 1384 message-body as if it were complete (i.e., some indication must be given 1385 to the user that an error occurred). Cache requirements for incomplete 1386 responses are defined in &cache-incomplete;. 1359 1387 </t> 1360 1388 </section> … … 1365 1393 There are a few header fields which have general applicability for 1366 1394 both request and response messages, but which do not apply to the 1367 entitybeing transferred. These header fields apply only to the1395 payload being transferred. These header fields apply only to the 1368 1396 message being transmitted. 1369 1397 </t> … … 1549 1577 Various ad-hoc limitations on request-target length are found in practice. 1550 1578 It is &RECOMMENDED; that all HTTP senders and recipients support 1551 request-target lengths of 8000 or more OCTETs.1579 request-target lengths of 8000 or more octets. 1552 1580 </t> 1553 1581 <x:note> … … 1761 1789 <t> 1762 1790 HTTP applications have historically allowed three different formats 1763 for the representation of date/time stamps. 1764 </t> 1765 <t> 1766 The first format is preferred as an Internet standard and represents 1791 for date/time stamps. 1792 However, the preferred format is 1767 1793 a fixed-length subset of that defined by <xref target="RFC1123"/>: 1768 1794 </t> … … 1779 1805 </artwork></figure> 1780 1806 <t> 1781 HTTP/1.1 clients and servers that parse thedate value &MUST; accept1807 HTTP/1.1 clients and servers that parse a date value &MUST; accept 1782 1808 all three formats (for compatibility with HTTP/1.0), though they &MUST; 1783 1809 only generate the RFC 1123 format for representing HTTP-date values … … 1909 1935 <t> 1910 1936 Transfer-coding values are used to indicate an encoding 1911 transformation that has been, can be, or may need to be applied to a n1912 entity-body in order to ensure "safe transport" through the network.1937 transformation that has been, can be, or may need to be applied to a 1938 payload body in order to ensure "safe transport" through the network. 1913 1939 This differs from a content coding in that the transfer-coding is a 1914 property of the message, not of the original entity. 1940 property of the message rather than a property of the representation 1941 that is being transferred. 1915 1942 </t> 1916 1943 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="transfer-coding"/><iref primary="true" item="Grammar" subitem="transfer-extension"/> … … 1926 1953 <x:anchor-alias value="transfer-parameter"/> 1927 1954 <x:anchor-alias value="value"/> 1928 Parameters are in 1955 Parameters are in the form of attribute/value pairs. 1929 1956 </t> 1930 1957 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="transfer-parameter"/><iref primary="true" item="Grammar" subitem="attribute"/><iref primary="true" item="Grammar" subitem="value"/><iref primary="true" item="Grammar" subitem="date2"/><iref primary="true" item="Grammar" subitem="date3"/> … … 1939 1966 </t> 1940 1967 <t> 1941 Whenever a transfer-coding is applied to a message-body, the set of1968 Whenever a transfer-coding is applied to a payload body, the set of 1942 1969 transfer-codings &MUST; include "chunked", unless the message indicates it 1943 1970 is terminated by closing the connection. When the "chunked" transfer-coding 1944 is used, it &MUST; be the last transfer-coding applied to the1971 is used, it &MUST; be the last transfer-coding applied to form the 1945 1972 message-body. The "chunked" transfer-coding &MUST-NOT; be applied more 1946 1973 than once to a message-body. These rules allow the recipient to 1947 determine the transfer-length of the message (<xref target="message.length"/>).1974 determine the message-body length of the message (<xref target="message.body.length"/>). 1948 1975 </t> 1949 1976 <t> … … 1954 1981 has a different focus for an 8bit-clean transfer protocol. In HTTP, 1955 1982 the only unsafe characteristic of message-bodies is the difficulty in 1956 determining the exact body length (<xref target="message. length"/>), or the desire to1983 determining the exact body length (<xref target="message.body.length"/>), or the desire to 1957 1984 encrypt data over a shared transport. 1958 1985 </t> 1959 1986 <t> 1960 A server which receives an entity-bodywith a transfer-coding it does1961 not understand &SHOULD; re turn 501 (Not Implemented), and close the1962 c onnection. A server &MUST-NOT; send transfer-codings to an HTTP/1.01987 A server that receives a request message with a transfer-coding it does 1988 not understand &SHOULD; respond with 501 (Not Implemented) and then 1989 close the connection. A server &MUST-NOT; send transfer-codings to an HTTP/1.0 1963 1990 client. 1964 1991 </t> … … 2053 2080 while (chunk-size > 0) { 2054 2081 read chunk-data and CRLF 2055 append chunk-data to entity-body2082 append chunk-data to decoded-body 2056 2083 length := length + chunk-size 2057 2084 read chunk-size and CRLF 2058 2085 } 2059 read entity-header2060 while ( entity-headernot empty) {2061 append entity-headerto existing header fields2062 read entity-header2086 read header-field 2087 while (header-field not empty) { 2088 append header-field to existing header fields 2089 read header-field 2063 2090 } 2064 2091 Content-Length := length … … 2067 2094 <t> 2068 2095 All HTTP/1.1 applications &MUST; be able to receive and decode the 2069 "chunked" transfer-coding ,and &MUST; ignore chunk-ext extensions2096 "chunked" transfer-coding and &MUST; ignore chunk-ext extensions 2070 2097 they do not understand. 2071 2098 </t> … … 2321 2348 In order to remain persistent, all messages on the connection &MUST; 2322 2349 have a self-defined message length (i.e., one not defined by closure 2323 of the connection), as described in <xref target="message. length"/>.2350 of the connection), as described in <xref target="message.body.length"/>. 2324 2351 </t> 2325 2352 </section> … … 2475 2502 </x:note> 2476 2503 <t> 2477 The Content-Length field of a request or response is added or deleted 2478 according to the rules in <xref target="message.length"/>. A transparent proxy &MUST; 2479 preserve the entity-length (&entity-length;) of the entity-body, 2480 although it &MAY; change the transfer-length (<xref target="message.length"/>). 2504 A transparent proxy &MUST; preserve the message payload (&payload;), 2505 though it &MAY; change the message-body through application or removal 2506 of a transfer-coding (<xref target="transfer.codings"/>). 2481 2507 </t> 2482 2508 </section> … … 2858 2884 <x:anchor-alias value="Content-Length-v"/> 2859 2885 <t> 2860 The "Content-Length" entity-header field indicates the size of the 2861 entity-body, in number of OCTETs. In the case of responses to the HEAD 2862 method, it indicates the size of the entity-body that would have been sent 2863 had the request been a GET. 2886 The "Content-Length" header field indicates the size of the 2887 message-body, in decimal number of octets, for any message other than 2888 a response to the HEAD method or a response with a status code of 304. 2889 In the case of responses to the HEAD method, it indicates the size of 2890 the payload body (not including any potential transfer-coding) that 2891 would have been sent had the request been a GET. 2892 In the case of the 304 (Not Modified) response, it indicates the size of 2893 the payload body (not including any potential transfer-coding) that 2894 would have been sent in a 200 (OK) response. 2864 2895 </t> 2865 2896 <figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Length"/><iref primary="true" item="Grammar" subitem="Content-Length-v"/> … … 2874 2905 </artwork></figure> 2875 2906 <t> 2876 Applications &SHOULD; use this field to indicate the transfer-length of 2877 the message-body, unless this is prohibited by the rules in <xref target="message.length"/>. 2907 Implementations &SHOULD; use this field to indicate the message-body 2908 length when no transfer-coding is being applied and the 2909 payload's body length can be determined prior to being transferred. 2878 2910 </t> 2879 2911 <t> 2880 2912 Any Content-Length greater than or equal to zero is a valid value. 2881 <xref target="message. length"/> describes how to determine the length of a message-body2913 <xref target="message.body.length"/> describes how to determine the length of a message-body 2882 2914 if a Content-Length is not given. 2883 2915 </t> … … 2885 2917 Note that the meaning of this field is significantly different from 2886 2918 the corresponding definition in MIME, where it is an optional field 2887 used within the "message/external-body" content-type. In HTTP, it 2888 &SHOULD; be sent whenever the message's length can be determined prior 2889 to being transferred, unless this is prohibited by the rules in 2890 <xref target="message.length"/>. 2919 used within the "message/external-body" content-type. 2891 2920 </t> 2892 2921 </section> … … 2943 2972 <t> 2944 2973 Clients &SHOULD; only send a Date header field in messages that include 2945 a n entity-body, as in the case of thePUT and POST requests, and even2974 a payload, as is usually the case for PUT and POST requests, and even 2946 2975 then it is optional. A client without a clock &MUST-NOT; send a Date 2947 2976 header field in a request. … … 2953 2982 generation, unless the implementation has no means of generating a 2954 2983 reasonably accurate date and time. In theory, the date ought to 2955 represent the moment just before the entityis generated. In2984 represent the moment just before the payload is generated. In 2956 2985 practice, the date can be generated at any time during the message 2957 2986 origination without affecting its semantic value. … … 4672 4701 </t> 4673 4702 <t> 4674 The character set of a n entity-body&SHOULD; be labeled as the lowest4675 common denominator of the character codes used within that body, with4676 the exception that not labeling the entityis preferred over labeling4677 the entitywith the labels US-ASCII or ISO-8859-1. See &payload;.4703 The character set of a representation &SHOULD; be labeled as the lowest 4704 common denominator of the character codes used within that representation, with 4705 the exception that not labeling the representation is preferred over labeling 4706 the representation with the labels US-ASCII or ISO-8859-1. See &payload;. 4678 4707 </t> 4679 4708 <t> … … 4844 4873 transfer encoding that may not be self delimiting); it was important 4845 4874 to straighten out exactly how message lengths are computed. (Sections 4846 <xref target="transfer.codings" format="counter"/>, <xref target="message. length" format="counter"/>,4875 <xref target="transfer.codings" format="counter"/>, <xref target="message.body.length" format="counter"/>, 4847 4876 <xref target="header.content-length" format="counter"/>, 4848 4877 see also <xref target="Part3"/>, <xref target="Part5"/> and <xref target="Part6"/>) … … 4901 4930 Remove reference to non-existent identity transfer-coding value tokens. 4902 4931 (Sections <xref format="counter" target="transfer.codings"/> and 4903 <xref format="counter" target="message. length"/>)4932 <xref format="counter" target="message.body.length"/>) 4904 4933 </t> 4905 4934 <t> … … 5029 5058 / %x53.75.6E.64.61.79 ; Sunday 5030 5059 5031 <x:ref>entity-body</x:ref> = <entity-body, defined in [Part3], Section 3.2>5032 5060 <x:ref>entity-header</x:ref> = <entity-header, defined in [Part3], Section 3.1> 5033 5061 … … 5046 5074 <x:ref>last-chunk</x:ref> = 1*"0" *WSP [ chunk-ext ] CRLF 5047 5075 5048 <x:ref>message-body</x:ref> = entity-body / 5049 <entity-body encoded as per Transfer-Encoding> 5076 <x:ref>message-body</x:ref> = *OCTET 5050 5077 <x:ref>minute</x:ref> = 2DIGIT 5051 5078 <x:ref>month</x:ref> = %x4A.61.6E ; Jan -
draft-ietf-httpbis/latest/p3-payload.xml
r848 r852 27 27 <!ENTITY header-vary "<xref target='Part6' x:rel='#header.vary' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 28 28 <!ENTITY message-body "<xref target='Part1' x:rel='#message.body' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 29 <!ENTITY message-length "<xref target='Part1' x:rel='#message. length' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">29 <!ENTITY message-length "<xref target='Part1' x:rel='#message.body.length' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 30 30 <!ENTITY header-fields "<xref target='Part1' x:rel='#header.fields' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 31 31 <!ENTITY multipart-byteranges "<xref target='Part5' x:rel='#internet.media.type.multipart.byteranges' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> … … 654 654 value. The message body is itself a protocol element and &MUST; 655 655 therefore use only CRLF to represent line breaks between body-parts. 656 Unlike in RFC 2046, the epilogue of any multipart message &MUST; be657 empty; HTTP applications &MUST-NOT; transmit the epilogue (even if the658 original multipart contains an epilogue). These restrictions exist in659 order to preserve the self-delimiting nature of a multipart message-body,660 wherein the "end" of the message-body is indicated by the661 ending multipart boundary.662 656 </t> 663 657 <t> 664 658 In general, HTTP treats a multipart message-body no differently than 665 any other media type: strictly as payload. The one exception is the 666 "multipart/byteranges" type (&multipart-byteranges;) when it appears in a 206 667 (Partial Content) response. 659 any other media type: strictly as payload. HTTP does not use the 660 multipart boundary as an indicator of message-body length. 668 661 <!-- jre: re-insert removed text pointing to caching? --> 669 In all 670 other cases, an HTTP user agent &SHOULD; follow the same or similar 662 In all other respects, an HTTP user agent &SHOULD; follow the same or similar 671 663 behavior as a MIME user agent would upon receipt of a multipart type. 672 664 The MIME header fields within each body-part of a multipart message-body … … 675 667 </t> 676 668 <t> 677 In general, an HTTP user agent &SHOULD; follow the same or similar678 behavior as a MIME user agent would upon receipt of a multipart type.679 669 If an application receives an unrecognized multipart subtype, the 680 670 application &MUST; treat it as being equivalent to "multipart/mixed". … … 822 812 </section> 823 813 824 <section title="Entity Length" anchor="entity.length">825 <t>826 The entity-length of a message is the length of the message-body827 before any transfer-codings have been applied. &message-length; defines828 how the transfer-length of a message-body is determined.829 </t>830 </section>831 814 </section> 832 815 </section> … … 2734 2717 transfer encoding that may not be self delimiting); it was important 2735 2718 to straighten out exactly how message lengths are computed. 2736 (<xref target="entity.length"/>, see also <xref target="Part1"/>,2737 <xref target="Part5"/> and <xref target="Part6"/>).2738 2719 </t> 2739 2720 <t> -
draft-ietf-httpbis/latest/p5-range.xml
r848 r852 357 357 Content-Type including Content-Range fields for each part. If a 358 358 Content-Length header field is present in the response, its 359 value &MUST; match the actual number of OCTETs transmitted in the359 value &MUST; match the actual number of octets transmitted in the 360 360 message-body. 361 361 </t> -
draft-ietf-httpbis/latest/p6-cache.xml
r848 r852 30 30 <!ENTITY header-last-modified "<xref target='Part4' x:rel='#header.last-modified' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 31 31 <!ENTITY header-fields "<xref target='Part1' x:rel='#header.fields' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 32 <!ENTITY message-length "<xref target='Part1' x:rel='#message.length' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">33 32 <!ENTITY safe-methods "<xref target='Part2' x:rel='#safe.methods' xmlns:x='http://purl.org/net/xml2rfc/ext'/>"> 34 33 <!ENTITY weak-and-strong "<xref target='Part4' x:rel='#weak.and.strong.validators' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
Note: See TracChangeset
for help on using the changeset viewer.