idnits 2.17.1 draft-ietf-httpbis-messaging-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The draft header indicates that this document obsoletes RFC7230, but the abstract doesn't seem to directly say this. It does mention RFC7230 though, so this could be OK. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (May 31, 2018) is 2157 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'RFC3986' is defined on line 1995, but no explicit reference was found in the text == Unused Reference: 'RFC7230' is defined on line 2071, but no explicit reference was found in the text == Unused Reference: 'RFC7231' is defined on line 2076, but no explicit reference was found in the text == Outdated reference: A later version (-19) exists of draft-ietf-httpbis-cache-01 -- Possible downref: Normative reference to a draft: ref. 'Caching' ** Downref: Normative reference to an Informational RFC: RFC 1950 ** Downref: Normative reference to an Informational RFC: RFC 1951 ** Downref: Normative reference to an Informational RFC: RFC 1952 == Outdated reference: A later version (-19) exists of draft-ietf-httpbis-semantics-01 -- Possible downref: Normative reference to a draft: ref. 'Semantics' -- Possible downref: Non-RFC (?) normative reference: ref. 'USASCII' -- Possible downref: Non-RFC (?) normative reference: ref. 'Welch' -- Obsolete informational reference (is this intentional?): RFC 2068 (Obsoleted by RFC 2616) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 7230 (Obsoleted by RFC 9110, RFC 9112) -- Obsolete informational reference (is this intentional?): RFC 7231 (Obsoleted by RFC 9110) Summary: 3 errors (**), 0 flaws (~~), 7 warnings (==), 10 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HTTP Working Group R. Fielding, Ed. 3 Internet-Draft Adobe 4 Obsoletes: 7230 (if approved) M. Nottingham, Ed. 5 Intended status: Standards Track Fastly 6 Expires: December 2, 2018 J. Reschke, Ed. 7 greenbytes 8 May 31, 2018 10 HTTP/1.1 Messaging 11 draft-ietf-httpbis-messaging-01 13 Abstract 15 The Hypertext Transfer Protocol (HTTP) is a stateless application- 16 level protocol for distributed, collaborative, hypertext information 17 systems. This document specifies the HTTP/1.1 message syntax, 18 message parsing, connection management, and related security 19 concerns. 21 This document obsoletes portions of RFC 7230. 23 Editorial Note 25 This note is to be removed before publishing as an RFC. 27 Discussion of this draft takes place on the HTTP working group 28 mailing list (ietf-http-wg@w3.org), which is archived at 29 . 31 Working Group information can be found at ; 32 source code and issues list for this draft can be found at 33 . 35 The changes in this draft are summarized in Appendix D.2. 37 Status of This Memo 39 This Internet-Draft is submitted in full conformance with the 40 provisions of BCP 78 and BCP 79. 42 Internet-Drafts are working documents of the Internet Engineering 43 Task Force (IETF). Note that other groups may also distribute 44 working documents as Internet-Drafts. The list of current Internet- 45 Drafts is at https://datatracker.ietf.org/drafts/current/. 47 Internet-Drafts are draft documents valid for a maximum of six months 48 and may be updated, replaced, or obsoleted by other documents at any 49 time. It is inappropriate to use Internet-Drafts as reference 50 material or to cite them other than as "work in progress." 52 This Internet-Draft will expire on December 2, 2018. 54 Copyright Notice 56 Copyright (c) 2018 IETF Trust and the persons identified as the 57 document authors. All rights reserved. 59 This document is subject to BCP 78 and the IETF Trust's Legal 60 Provisions Relating to IETF Documents 61 (https://trustee.ietf.org/license-info) in effect on the date of 62 publication of this document. Please review these documents 63 carefully, as they describe your rights and restrictions with respect 64 to this document. Code Components extracted from this document must 65 include Simplified BSD License text as described in Section 4.e of 66 the Trust Legal Provisions and are provided without warranty as 67 described in the Simplified BSD License. 69 This document may contain material from IETF Documents or IETF 70 Contributions published or made publicly available before November 71 10, 2008. The person(s) controlling the copyright in some of this 72 material may not have granted the IETF Trust the right to allow 73 modifications of such material outside the IETF Standards Process. 74 Without obtaining an adequate license from the person(s) controlling 75 the copyright in such materials, this document may not be modified 76 outside the IETF Standards Process, and derivative works of it may 77 not be created outside the IETF Standards Process, except to format 78 it for publication as an RFC or to translate it into languages other 79 than English. 81 Table of Contents 83 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 84 1.1. Requirements Notation . . . . . . . . . . . . . . . . . . 5 85 1.2. Syntax Notation . . . . . . . . . . . . . . . . . . . . . 5 86 2. Message . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 87 2.1. Message Format . . . . . . . . . . . . . . . . . . . . . 6 88 2.2. HTTP Version . . . . . . . . . . . . . . . . . . . . . . 6 89 2.3. Message Parsing . . . . . . . . . . . . . . . . . . . . . 7 90 3. Request Line . . . . . . . . . . . . . . . . . . . . . . . . 8 91 3.1. Method . . . . . . . . . . . . . . . . . . . . . . . . . 9 92 3.2. Request Target . . . . . . . . . . . . . . . . . . . . . 9 93 3.2.1. origin-form . . . . . . . . . . . . . . . . . . . . . 10 94 3.2.2. absolute-form . . . . . . . . . . . . . . . . . . . . 10 95 3.2.3. authority-form . . . . . . . . . . . . . . . . . . . 11 96 3.2.4. asterisk-form . . . . . . . . . . . . . . . . . . . . 11 98 3.3. Effective Request URI . . . . . . . . . . . . . . . . . . 12 99 4. Status Line . . . . . . . . . . . . . . . . . . . . . . . . . 13 100 5. Header Fields . . . . . . . . . . . . . . . . . . . . . . . . 14 101 5.1. Field Parsing . . . . . . . . . . . . . . . . . . . . . . 15 102 5.2. Obsolete Line Folding . . . . . . . . . . . . . . . . . . 15 103 6. Message Body . . . . . . . . . . . . . . . . . . . . . . . . 16 104 6.1. Transfer-Encoding . . . . . . . . . . . . . . . . . . . . 17 105 6.2. Content-Length . . . . . . . . . . . . . . . . . . . . . 18 106 6.3. Message Body Length . . . . . . . . . . . . . . . . . . . 19 107 7. Transfer Codings . . . . . . . . . . . . . . . . . . . . . . 21 108 7.1. Chunked Transfer Coding . . . . . . . . . . . . . . . . . 22 109 7.1.1. Chunk Extensions . . . . . . . . . . . . . . . . . . 22 110 7.1.2. Chunked Trailer Part . . . . . . . . . . . . . . . . 23 111 7.1.3. Decoding Chunked . . . . . . . . . . . . . . . . . . 24 112 7.2. Transfer Codings for Compression . . . . . . . . . . . . 24 113 7.3. Transfer Coding Registry . . . . . . . . . . . . . . . . 25 114 7.4. TE . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 115 8. Handling Incomplete Messages . . . . . . . . . . . . . . . . 26 116 9. Connection Management . . . . . . . . . . . . . . . . . . . . 27 117 9.1. Connection . . . . . . . . . . . . . . . . . . . . . . . 27 118 9.2. Establishment . . . . . . . . . . . . . . . . . . . . . . 29 119 9.3. Persistence . . . . . . . . . . . . . . . . . . . . . . . 29 120 9.3.1. Retrying Requests . . . . . . . . . . . . . . . . . . 30 121 9.3.2. Pipelining . . . . . . . . . . . . . . . . . . . . . 31 122 9.4. Concurrency . . . . . . . . . . . . . . . . . . . . . . . 31 123 9.5. Failures and Timeouts . . . . . . . . . . . . . . . . . . 32 124 9.6. Tear-down . . . . . . . . . . . . . . . . . . . . . . . . 33 125 9.7. Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . 34 126 9.7.1. Upgrade Protocol Names . . . . . . . . . . . . . . . 36 127 9.7.2. Upgrade Token Registry . . . . . . . . . . . . . . . 36 128 10. Enclosing Messages as Data . . . . . . . . . . . . . . . . . 37 129 10.1. Media Type message/http . . . . . . . . . . . . . . . . 37 130 10.2. Media Type application/http . . . . . . . . . . . . . . 38 131 11. Security Considerations . . . . . . . . . . . . . . . . . . . 39 132 11.1. Response Splitting . . . . . . . . . . . . . . . . . . . 39 133 11.2. Request Smuggling . . . . . . . . . . . . . . . . . . . 40 134 11.3. Message Integrity . . . . . . . . . . . . . . . . . . . 40 135 11.4. Message Confidentiality . . . . . . . . . . . . . . . . 41 136 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 41 137 12.1. Header Field Registration . . . . . . . . . . . . . . . 41 138 12.2. Media Type Registration . . . . . . . . . . . . . . . . 42 139 12.3. Transfer Coding Registration . . . . . . . . . . . . . . 42 140 12.4. Upgrade Token Registration . . . . . . . . . . . . . . . 42 141 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 42 142 13.1. Normative References . . . . . . . . . . . . . . . . . . 42 143 13.2. Informative References . . . . . . . . . . . . . . . . . 43 144 Appendix A. Collected ABNF . . . . . . . . . . . . . . . . . . . 45 145 Appendix B. Differences between HTTP and MIME . . . . . . . . . 46 146 B.1. MIME-Version . . . . . . . . . . . . . . . . . . . . . . 47 147 B.2. Conversion to Canonical Form . . . . . . . . . . . . . . 47 148 B.3. Conversion of Date Formats . . . . . . . . . . . . . . . 47 149 B.4. Conversion of Content-Encoding . . . . . . . . . . . . . 48 150 B.5. Conversion of Content-Transfer-Encoding . . . . . . . . . 48 151 B.6. MHTML and Line Length Limitations . . . . . . . . . . . . 48 152 Appendix C. HTTP Version History . . . . . . . . . . . . . . . . 48 153 C.1. Changes from HTTP/1.0 . . . . . . . . . . . . . . . . . . 49 154 C.1.1. Multihomed Web Servers . . . . . . . . . . . . . . . 49 155 C.1.2. Keep-Alive Connections . . . . . . . . . . . . . . . 50 156 C.1.3. Introduction of Transfer-Encoding . . . . . . . . . . 50 157 C.2. Changes from RFC 7230 . . . . . . . . . . . . . . . . . . 50 158 Appendix D. Change Log . . . . . . . . . . . . . . . . . . . . . 51 159 D.1. Between RFC7230 and draft 00 . . . . . . . . . . . . . . 51 160 D.2. Since draft-ietf-httpbis-messaging-00 . . . . . . . . . . 51 161 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 162 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 54 163 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 54 165 1. Introduction 167 The Hypertext Transfer Protocol (HTTP) is a stateless application- 168 level request/response protocol that uses extensible semantics and 169 self-descriptive messages for flexible interaction with network-based 170 hypertext information systems. HTTP is defined by a series of 171 documents that collectively form the HTTP/1.1 specification: 173 o "HTTP Semantics" [Semantics] 175 o "HTTP Caching" [Caching] 177 o "HTTP/1.1 Messaging" (this document) 179 This document defines HTTP/1.1 message syntax and framing 180 requirements and their associated connection management. Our goal is 181 to define all of the mechanisms necessary for HTTP/1.1 message 182 handling that are independent of message semantics, thereby defining 183 the complete set of requirements for message parsers and message- 184 forwarding intermediaries. 186 This document obsoletes the portions of RFC 7230 related to HTTP/1.1 187 messaging and connection management, with the changes being 188 summarized in Appendix C.2. The other parts of RFC 7230 are 189 obsoleted by "HTTP Semantics" [Semantics]. 191 1.1. Requirements Notation 193 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 194 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 195 document are to be interpreted as described in [RFC2119]. 197 Conformance criteria and considerations regarding error handling are 198 defined in Section 3 of [Semantics]. 200 1.2. Syntax Notation 202 This specification uses the Augmented Backus-Naur Form (ABNF) 203 notation of [RFC5234] with a list extension, defined in Section 11 of 204 [Semantics], that allows for compact definition of comma-separated 205 lists using a '#' operator (similar to how the '*' operator indicates 206 repetition). Appendix A shows the collected grammar with all list 207 operators expanded to standard ABNF notation. 209 As a convention, ABNF rule names prefixed with "obs-" denote 210 "obsolete" grammar rules that appear for historical reasons. 212 The following core rules are included by reference, as defined in 213 [RFC5234], Appendix B.1: ALPHA (letters), CR (carriage return), CRLF 214 (CR LF), CTL (controls), DIGIT (decimal 0-9), DQUOTE (double quote), 215 HEXDIG (hexadecimal 0-9/A-F/a-f), HTAB (horizontal tab), LF (line 216 feed), OCTET (any 8-bit sequence of data), SP (space), and VCHAR (any 217 visible [USASCII] character). 219 The rules below are defined in [Semantics]: 221 BWS = 222 OWS = 223 RWS = 224 absolute-URI = 225 absolute-path = 226 authority = 227 comment = 228 field-name = 229 field-value = 230 obs-text = 231 port = 232 query = 233 quoted-string = 234 token = 235 uri-host = 237 2. Message 239 2.1. Message Format 241 All HTTP/1.1 messages consist of a start-line followed by a sequence 242 of octets in a format similar to the Internet Message Format 243 [RFC5322]: zero or more header fields (collectively referred to as 244 the "headers" or the "header section"), an empty line indicating the 245 end of the header section, and an optional message body. 247 HTTP-message = start-line 248 *( header-field CRLF ) 249 CRLF 250 [ message-body ] 252 An HTTP message can be either a request from client to server or a 253 response from server to client. Syntactically, the two types of 254 message differ only in the start-line, which is either a request-line 255 (for requests) or a status-line (for responses), and in the algorithm 256 for determining the length of the message body (Section 6). 258 start-line = request-line / status-line 260 In theory, a client could receive requests and a server could receive 261 responses, distinguishing them by their different start-line formats. 262 In practice, servers are implemented to only expect a request (a 263 response is interpreted as an unknown or invalid request method) and 264 clients are implemented to only expect a response. 266 [[CREF1: Although HTTP makes use of some protocol elements similar to 267 the Multipurpose Internet Mail Extensions (MIME) [RFC2045], see 268 Appendix B for the differences between HTTP and MIME messages.]] 270 2.2. HTTP Version 272 HTTP uses a "." numbering scheme to indicate versions 273 of the protocol. This specification defines version "1.1". 274 Section 3.5 of [Semantics] specifies the semantics of HTTP version 275 numbers. 277 The version of an HTTP/1.x message is indicated by an HTTP-version 278 field in the start-line. HTTP-version is case-sensitive. 280 HTTP-version = HTTP-name "/" DIGIT "." DIGIT 281 HTTP-name = %x48.54.54.50 ; "HTTP", case-sensitive 283 When an HTTP/1.1 message is sent to an HTTP/1.0 recipient [RFC1945] 284 or a recipient whose version is unknown, the HTTP/1.1 message is 285 constructed such that it can be interpreted as a valid HTTP/1.0 286 message if all of the newer features are ignored. This specification 287 places recipient-version requirements on some new features so that a 288 conformant sender will only use compatible features until it has 289 determined, through configuration or the receipt of a message, that 290 the recipient supports HTTP/1.1. 292 Intermediaries that process HTTP messages (i.e., all intermediaries 293 other than those acting as tunnels) MUST send their own HTTP-version 294 in forwarded messages. In other words, they are not allowed to 295 blindly forward the start-line without ensuring that the protocol 296 version in that message matches a version to which that intermediary 297 is conformant for both the receiving and sending of messages. 298 Forwarding an HTTP message without rewriting the HTTP-version might 299 result in communication errors when downstream recipients use the 300 message sender's version to determine what features are safe to use 301 for later communication with that sender. 303 A server MAY send an HTTP/1.0 response to an HTTP/1.1 request if it 304 is known or suspected that the client incorrectly implements the HTTP 305 specification and is incapable of correctly processing later version 306 responses, such as when a client fails to parse the version number 307 correctly or when an intermediary is known to blindly forward the 308 HTTP-version even when it doesn't conform to the given minor version 309 of the protocol. Such protocol downgrades SHOULD NOT be performed 310 unless triggered by specific client attributes, such as when one or 311 more of the request header fields (e.g., User-Agent) uniquely match 312 the values sent by a client known to be in error. 314 2.3. Message Parsing 316 The normal procedure for parsing an HTTP message is to read the 317 start-line into a structure, read each header field into a hash table 318 by field name until the empty line, and then use the parsed data to 319 determine if a message body is expected. If a message body has been 320 indicated, then it is read as a stream until an amount of octets 321 equal to the message body length is read or the connection is closed. 323 A recipient MUST parse an HTTP message as a sequence of octets in an 324 encoding that is a superset of US-ASCII [USASCII]. Parsing an HTTP 325 message as a stream of Unicode characters, without regard for the 326 specific encoding, creates security vulnerabilities due to the 327 varying ways that string processing libraries handle invalid 328 multibyte character sequences that contain the octet LF (%x0A). 329 String-based parsers can only be safely used within protocol elements 330 after the element has been extracted from the message, such as within 331 a header field-value after message parsing has delineated the 332 individual fields. 334 Although the line terminator for the start-line and header fields is 335 the sequence CRLF, a recipient MAY recognize a single LF as a line 336 terminator and ignore any preceding CR. 338 Older HTTP/1.0 user agent implementations might send an extra CRLF 339 after a POST request as a workaround for some early server 340 applications that failed to read message body content that was not 341 terminated by a line-ending. An HTTP/1.1 user agent MUST NOT preface 342 or follow a request with an extra CRLF. If terminating the request 343 message body with a line-ending is desired, then the user agent MUST 344 count the terminating CRLF octets as part of the message body length. 346 In the interest of robustness, a server that is expecting to receive 347 and parse a request-line SHOULD ignore at least one empty line (CRLF) 348 received prior to the request-line. 350 A sender MUST NOT send whitespace between the start-line and the 351 first header field. A recipient that receives whitespace between the 352 start-line and the first header field MUST either reject the message 353 as invalid or consume each whitespace-preceded line without further 354 processing of it (i.e., ignore the entire line, along with any 355 subsequent lines preceded by whitespace, until a properly formed 356 header field is received or the header section is terminated). 358 The presence of such whitespace in a request might be an attempt to 359 trick a server into ignoring that field or processing the line after 360 it as a new request, either of which might result in a security 361 vulnerability if other implementations within the request chain 362 interpret the same message differently. Likewise, the presence of 363 such whitespace in a response might be ignored by some clients or 364 cause others to cease parsing. 366 When a server listening only for HTTP request messages, or processing 367 what appears from the start-line to be an HTTP request message, 368 receives a sequence of octets that does not match the HTTP-message 369 grammar aside from the robustness exceptions listed above, the server 370 SHOULD respond with a 400 (Bad Request) response. 372 3. Request Line 374 A request-line begins with a method token, followed by a single space 375 (SP), the request-target, another single space (SP), the protocol 376 version, and ends with CRLF. 378 request-line = method SP request-target SP HTTP-version CRLF 380 Although the request-line grammar rule requires that each of the 381 component elements be separated by a single SP octet, recipients MAY 382 instead parse on whitespace-delimited word boundaries and, aside from 383 the CRLF terminator, treat any form of whitespace as the SP separator 384 while ignoring preceding or trailing whitespace; such whitespace 385 includes one or more of the following octets: SP, HTAB, VT (%x0B), FF 386 (%x0C), or bare CR. However, lenient parsing can result in request 387 smuggling security vulnerabilities if there are multiple recipients 388 of the message and each has its own unique interpretation of 389 robustness (see Section 11.2). 391 HTTP does not place a predefined limit on the length of a request- 392 line, as described in Section 3 of [Semantics]. A server that 393 receives a method longer than any that it implements SHOULD respond 394 with a 501 (Not Implemented) status code. A server that receives a 395 request-target longer than any URI it wishes to parse MUST respond 396 with a 414 (URI Too Long) status code (see Section 9.5.15 of 397 [Semantics]). 399 Various ad hoc limitations on request-line length are found in 400 practice. It is RECOMMENDED that all HTTP senders and recipients 401 support, at a minimum, request-line lengths of 8000 octets. 403 3.1. Method 405 The method token indicates the request method to be performed on the 406 target resource. The request method is case-sensitive. 408 method = token 410 The request methods defined by this specification can be found in 411 Section 7 of [Semantics], along with information regarding the HTTP 412 method registry and considerations for defining new methods. 414 3.2. Request Target 416 The request-target identifies the target resource upon which to apply 417 the request. The client derives a request-target from its desired 418 target URI. There are four distinct formats for the request-target, 419 depending on both the method being requested and whether the request 420 is to a proxy. 422 request-target = origin-form 423 / absolute-form 424 / authority-form 425 / asterisk-form 427 No whitespace is allowed in the request-target. Unfortunately, some 428 user agents fail to properly encode or exclude whitespace found in 429 hypertext references, resulting in those disallowed characters being 430 sent as the request-target in a malformed request-line. 432 Recipients of an invalid request-line SHOULD respond with either a 433 400 (Bad Request) error or a 301 (Moved Permanently) redirect with 434 the request-target properly encoded. A recipient SHOULD NOT attempt 435 to autocorrect and then process the request without a redirect, since 436 the invalid request-line might be deliberately crafted to bypass 437 security filters along the request chain. 439 3.2.1. origin-form 441 The most common form of request-target is the origin-form. 443 origin-form = absolute-path [ "?" query ] 445 When making a request directly to an origin server, other than a 446 CONNECT or server-wide OPTIONS request (as detailed below), a client 447 MUST send only the absolute path and query components of the target 448 URI as the request-target. If the target URI's path component is 449 empty, the client MUST send "/" as the path within the origin-form of 450 request-target. A Host header field is also sent, as defined in 451 Section 5.4 of [Semantics]. 453 For example, a client wishing to retrieve a representation of the 454 resource identified as 456 http://www.example.org/where?q=now 458 directly from the origin server would open (or reuse) a TCP 459 connection to port 80 of the host "www.example.org" and send the 460 lines: 462 GET /where?q=now HTTP/1.1 463 Host: www.example.org 465 followed by the remainder of the request message. 467 3.2.2. absolute-form 469 When making a request to a proxy, other than a CONNECT or server-wide 470 OPTIONS request (as detailed below), a client MUST send the target 471 URI in absolute-form as the request-target. 473 absolute-form = absolute-URI 475 The proxy is requested to either service that request from a valid 476 cache, if possible, or make the same request on the client's behalf 477 to either the next inbound proxy server or directly to the origin 478 server indicated by the request-target. Requirements on such 479 "forwarding" of messages are defined in Section 5.6 of [Semantics]. 481 An example absolute-form of request-line would be: 483 GET http://www.example.org/pub/WWW/TheProject.html HTTP/1.1 485 To allow for transition to the absolute-form for all requests in some 486 future version of HTTP, a server MUST accept the absolute-form in 487 requests, even though HTTP/1.1 clients will only send them in 488 requests to proxies. 490 3.2.3. authority-form 492 The authority-form of request-target is only used for CONNECT 493 requests (Section 7.3.6 of [Semantics]). 495 authority-form = authority 497 When making a CONNECT request to establish a tunnel through one or 498 more proxies, a client MUST send only the target URI's authority 499 component (excluding any userinfo and its "@" delimiter) as the 500 request-target. For example, 502 CONNECT www.example.com:80 HTTP/1.1 504 3.2.4. asterisk-form 506 The asterisk-form of request-target is only used for a server-wide 507 OPTIONS request (Section 7.3.7 of [Semantics]). 509 asterisk-form = "*" 511 When a client wishes to request OPTIONS for the server as a whole, as 512 opposed to a specific named resource of that server, the client MUST 513 send only "*" (%x2A) as the request-target. For example, 515 OPTIONS * HTTP/1.1 517 If a proxy receives an OPTIONS request with an absolute-form of 518 request-target in which the URI has an empty path and no query 519 component, then the last proxy on the request chain MUST send a 520 request-target of "*" when it forwards the request to the indicated 521 origin server. 523 For example, the request 525 OPTIONS http://www.example.org:8001 HTTP/1.1 527 would be forwarded by the final proxy as 529 OPTIONS * HTTP/1.1 530 Host: www.example.org:8001 532 after connecting to port 8001 of host "www.example.org". 534 3.3. Effective Request URI 536 Since the request-target often contains only part of the user agent's 537 target URI, a server reconstructs the intended target as an effective 538 request URI to properly service the request (Section 5.3 of 539 [Semantics]). 541 If the request-target is in absolute-form, the effective request URI 542 is the same as the request-target. Otherwise, the effective request 543 URI is constructed as follows: 545 If the server's configuration (or outbound gateway) provides a 546 fixed URI scheme, that scheme is used for the effective request 547 URI. Otherwise, if the request is received over a TLS-secured TCP 548 connection, the effective request URI's scheme is "https"; if not, 549 the scheme is "http". 551 If the server's configuration (or outbound gateway) provides a 552 fixed URI authority component, that authority is used for the 553 effective request URI. If not, then if the request-target is in 554 authority-form, the effective request URI's authority component is 555 the same as the request-target. If not, then if a Host header 556 field is supplied with a non-empty field-value, the authority 557 component is the same as the Host field-value. Otherwise, the 558 authority component is assigned the default name configured for 559 the server and, if the connection's incoming TCP port number 560 differs from the default port for the effective request URI's 561 scheme, then a colon (":") and the incoming port number (in 562 decimal form) are appended to the authority component. 564 If the request-target is in authority-form or asterisk-form, the 565 effective request URI's combined path and query component is 566 empty. Otherwise, the combined path and query component is the 567 same as the request-target. 569 The components of the effective request URI, once determined as 570 above, can be combined into absolute-URI form by concatenating the 571 scheme, "://", authority, and combined path and query component. 573 Example 1: the following message received over an insecure TCP 574 connection 576 GET /pub/WWW/TheProject.html HTTP/1.1 577 Host: www.example.org:8080 579 has an effective request URI of 581 http://www.example.org:8080/pub/WWW/TheProject.html 583 Example 2: the following message received over a TLS-secured TCP 584 connection 586 OPTIONS * HTTP/1.1 587 Host: www.example.org 589 has an effective request URI of 591 https://www.example.org 593 Recipients of an HTTP/1.0 request that lacks a Host header field 594 might need to use heuristics (e.g., examination of the URI path for 595 something unique to a particular host) in order to guess the 596 effective request URI's authority component. 598 4. Status Line 600 The first line of a response message is the status-line, consisting 601 of the protocol version, a space (SP), the status code, another 602 space, a possibly empty textual phrase describing the status code, 603 and ending with CRLF. 605 status-line = HTTP-version SP status-code SP reason-phrase CRLF 607 Although the status-line grammar rule requires that each of the 608 component elements be separated by a single SP octet, recipients MAY 609 instead parse on whitespace-delimited word boundaries and, aside from 610 the line terminator, treat any form of whitespace as the SP separator 611 while ignoring preceding or trailing whitespace; such whitespace 612 includes one or more of the following octets: SP, HTAB, VT (%x0B), FF 613 (%x0C), or bare CR. However, lenient parsing can result in response 614 splitting security vulnerabilities if there are multiple recipients 615 of the message and each has its own unique interpretation of 616 robustness (see Section 11.1). 618 The status-code element is a 3-digit integer code describing the 619 result of the server's attempt to understand and satisfy the client's 620 corresponding request. The rest of the response message is to be 621 interpreted in light of the semantics defined for that status code. 622 See Section 9 of [Semantics] for information about the semantics of 623 status codes, including the classes of status code (indicated by the 624 first digit), the status codes defined by this specification, 625 considerations for the definition of new status codes, and the IANA 626 registry. 628 status-code = 3DIGIT 630 The reason-phrase element exists for the sole purpose of providing a 631 textual description associated with the numeric status code, mostly 632 out of deference to earlier Internet application protocols that were 633 more frequently used with interactive text clients. A client SHOULD 634 ignore the reason-phrase content. 636 reason-phrase = *( HTAB / SP / VCHAR / obs-text ) 638 5. Header Fields 640 Each header field consists of a case-insensitive field name followed 641 by a colon (":"), optional leading whitespace, the field value, and 642 optional trailing whitespace. 644 header-field = field-name ":" OWS field-value OWS 646 [[CREF2: Most HTTP field names and the rules for parsing within field 647 values are defined in Section 4 of [Semantics]. This section covers 648 the generic syntax for header field inclusion within, and extraction 649 from, HTTP/1.1 messages. In addition, the following header fields 650 are defined by this document because they are specific to HTTP/1.1 651 message processing: ]] 653 +-------------------+----------+----------+---------------+ 654 | Header Field Name | Protocol | Status | Reference | 655 +-------------------+----------+----------+---------------+ 656 | Connection | http | standard | Section 9.1 | 657 | MIME-Version | http | standard | Appendix B.1 | 658 | TE | http | standard | Section 7.4 | 659 | Transfer-Encoding | http | standard | Section 6.1 | 660 | Upgrade | http | standard | Section 9.7 | 661 +-------------------+----------+----------+---------------+ 663 Furthermore, the field name "Close" is reserved, since using that 664 name as an HTTP header field might conflict with the "close" 665 connection option of the Connection header field (Section 9.1). 667 +-------------------+----------+----------+------------+ 668 | Header Field Name | Protocol | Status | Reference | 669 +-------------------+----------+----------+------------+ 670 | Close | http | reserved | Section 5 | 671 +-------------------+----------+----------+------------+ 673 5.1. Field Parsing 675 Messages are parsed using a generic algorithm, independent of the 676 individual header field names. The contents within a given field 677 value are not parsed until a later stage of message interpretation 678 (usually after the message's entire header section has been 679 processed). 681 No whitespace is allowed between the header field-name and colon. In 682 the past, differences in the handling of such whitespace have led to 683 security vulnerabilities in request routing and response handling. A 684 server MUST reject any received request message that contains 685 whitespace between a header field-name and colon with a response code 686 of 400 (Bad Request). A proxy MUST remove any such whitespace from a 687 response message before forwarding the message downstream. 689 A field value might be preceded and/or followed by optional 690 whitespace (OWS); a single SP preceding the field-value is preferred 691 for consistent readability by humans. The field value does not 692 include any leading or trailing whitespace: OWS occurring before the 693 first non-whitespace octet of the field value or after the last non- 694 whitespace octet of the field value ought to be excluded by parsers 695 when extracting the field value from a header field. 697 5.2. Obsolete Line Folding 699 Historically, HTTP header field values could be extended over 700 multiple lines by preceding each extra line with at least one space 701 or horizontal tab (obs-fold). This specification deprecates such 702 line folding except within the message/http media type 703 (Section 10.1). 705 obs-fold = CRLF 1*( SP / HTAB ) 706 ; obsolete line folding 708 A sender MUST NOT generate a message that includes line folding 709 (i.e., that has any field-value that contains a match to the obs-fold 710 rule) unless the message is intended for packaging within the 711 message/http media type. 713 A server that receives an obs-fold in a request message that is not 714 within a message/http container MUST either reject the message by 715 sending a 400 (Bad Request), preferably with a representation 716 explaining that obsolete line folding is unacceptable, or replace 717 each received obs-fold with one or more SP octets prior to 718 interpreting the field value or forwarding the message downstream. 720 A proxy or gateway that receives an obs-fold in a response message 721 that is not within a message/http container MUST either discard the 722 message and replace it with a 502 (Bad Gateway) response, preferably 723 with a representation explaining that unacceptable line folding was 724 received, or replace each received obs-fold with one or more SP 725 octets prior to interpreting the field value or forwarding the 726 message downstream. 728 A user agent that receives an obs-fold in a response message that is 729 not within a message/http container MUST replace each received obs- 730 fold with one or more SP octets prior to interpreting the field 731 value. 733 6. Message Body 735 The message body (if any) of an HTTP message is used to carry the 736 payload body of that request or response. The message body is 737 identical to the payload body unless a transfer coding has been 738 applied, as described in Section 6.1. 740 message-body = *OCTET 742 The rules for when a message body is allowed in a message differ for 743 requests and responses. 745 The presence of a message body in a request is signaled by a Content- 746 Length or Transfer-Encoding header field. Request message framing is 747 independent of method semantics, even if the method does not define 748 any use for a message body. 750 The presence of a message body in a response depends on both the 751 request method to which it is responding and the response status code 752 (Section 4). Responses to the HEAD request method (Section 7.3.2 of 753 [Semantics]) never include a message body because the associated 754 response header fields (e.g., Transfer-Encoding, Content-Length, 755 etc.), if present, indicate only what their values would have been if 756 the request method had been GET (Section 7.3.1 of [Semantics]). 2xx 757 (Successful) responses to a CONNECT request method (Section 7.3.6 of 758 [Semantics]) switch to tunnel mode instead of having a message body. 759 All 1xx (Informational), 204 (No Content), and 304 (Not Modified) 760 responses do not include a message body. All other responses do 761 include a message body, although the body might be of zero length. 763 6.1. Transfer-Encoding 765 The Transfer-Encoding header field lists the transfer coding names 766 corresponding to the sequence of transfer codings that have been (or 767 will be) applied to the payload body in order to form the message 768 body. Transfer codings are defined in Section 7. 770 Transfer-Encoding = 1#transfer-coding 772 Transfer-Encoding is analogous to the Content-Transfer-Encoding field 773 of MIME, which was designed to enable safe transport of binary data 774 over a 7-bit transport service ([RFC2045], Section 6). However, safe 775 transport has a different focus for an 8bit-clean transfer protocol. 776 In HTTP's case, Transfer-Encoding is primarily intended to accurately 777 delimit a dynamically generated payload and to distinguish payload 778 encodings that are only applied for transport efficiency or security 779 from those that are characteristics of the selected resource. 781 A recipient MUST be able to parse the chunked transfer coding 782 (Section 7.1) because it plays a crucial role in framing messages 783 when the payload body size is not known in advance. A sender MUST 784 NOT apply chunked more than once to a message body (i.e., chunking an 785 already chunked message is not allowed). If any transfer coding 786 other than chunked is applied to a request payload body, the sender 787 MUST apply chunked as the final transfer coding to ensure that the 788 message is properly framed. If any transfer coding other than 789 chunked is applied to a response payload body, the sender MUST either 790 apply chunked as the final transfer coding or terminate the message 791 by closing the connection. 793 For example, 795 Transfer-Encoding: gzip, chunked 797 indicates that the payload body has been compressed using the gzip 798 coding and then chunked using the chunked coding while forming the 799 message body. 801 Unlike Content-Encoding (Section 6.1.2 of [Semantics]), Transfer- 802 Encoding is a property of the message, not of the representation, and 803 any recipient along the request/response chain MAY decode the 804 received transfer coding(s) or apply additional transfer coding(s) to 805 the message body, assuming that corresponding changes are made to the 806 Transfer-Encoding field-value. Additional information about the 807 encoding parameters can be provided by other header fields not 808 defined by this specification. 810 Transfer-Encoding MAY be sent in a response to a HEAD request or in a 811 304 (Not Modified) response (Section 9.4.5 of [Semantics]) to a GET 812 request, neither of which includes a message body, to indicate that 813 the origin server would have applied a transfer coding to the message 814 body if the request had been an unconditional GET. This indication 815 is not required, however, because any recipient on the response chain 816 (including the origin server) can remove transfer codings when they 817 are not needed. 819 A server MUST NOT send a Transfer-Encoding header field in any 820 response with a status code of 1xx (Informational) or 204 (No 821 Content). A server MUST NOT send a Transfer-Encoding header field in 822 any 2xx (Successful) response to a CONNECT request (Section 7.3.6 of 823 [Semantics]). 825 Transfer-Encoding was added in HTTP/1.1. It is generally assumed 826 that implementations advertising only HTTP/1.0 support will not 827 understand how to process a transfer-encoded payload. A client MUST 828 NOT send a request containing Transfer-Encoding unless it knows the 829 server will handle HTTP/1.1 (or later) requests; such knowledge might 830 be in the form of specific user configuration or by remembering the 831 version of a prior received response. A server MUST NOT send a 832 response containing Transfer-Encoding unless the corresponding 833 request indicates HTTP/1.1 (or later). 835 A server that receives a request message with a transfer coding it 836 does not understand SHOULD respond with 501 (Not Implemented). 838 6.2. Content-Length 840 When a message does not have a Transfer-Encoding header field, a 841 Content-Length header field can provide the anticipated size, as a 842 decimal number of octets, for a potential payload body. For messages 843 that do include a payload body, the Content-Length field-value 844 provides the framing information necessary for determining where the 845 body (and message) ends. For messages that do not include a payload 846 body, the Content-Length indicates the size of the selected 847 representation (Section 6.2.4 of [Semantics]). 849 Note: HTTP's use of Content-Length for message framing differs 850 significantly from the same field's use in MIME, where it is an 851 optional field used only within the "message/external-body" media- 852 type. 854 6.3. Message Body Length 856 The length of a message body is determined by one of the following 857 (in order of precedence): 859 1. Any response to a HEAD request and any response with a 1xx 860 (Informational), 204 (No Content), or 304 (Not Modified) status 861 code is always terminated by the first empty line after the 862 header fields, regardless of the header fields present in the 863 message, and thus cannot contain a message body. 865 2. Any 2xx (Successful) response to a CONNECT request implies that 866 the connection will become a tunnel immediately after the empty 867 line that concludes the header fields. A client MUST ignore any 868 Content-Length or Transfer-Encoding header fields received in 869 such a message. 871 3. If a Transfer-Encoding header field is present and the chunked 872 transfer coding (Section 7.1) is the final encoding, the message 873 body length is determined by reading and decoding the chunked 874 data until the transfer coding indicates the data is complete. 876 If a Transfer-Encoding header field is present in a response and 877 the chunked transfer coding is not the final encoding, the 878 message body length is determined by reading the connection until 879 it is closed by the server. If a Transfer-Encoding header field 880 is present in a request and the chunked transfer coding is not 881 the final encoding, the message body length cannot be determined 882 reliably; the server MUST respond with the 400 (Bad Request) 883 status code and then close the connection. 885 If a message is received with both a Transfer-Encoding and a 886 Content-Length header field, the Transfer-Encoding overrides the 887 Content-Length. Such a message might indicate an attempt to 888 perform request smuggling (Section 11.2) or response splitting 889 (Section 11.1) and ought to be handled as an error. A sender 890 MUST remove the received Content-Length field prior to forwarding 891 such a message downstream. 893 4. If a message is received without Transfer-Encoding and with 894 either multiple Content-Length header fields having differing 895 field-values or a single Content-Length header field having an 896 invalid value, then the message framing is invalid and the 897 recipient MUST treat it as an unrecoverable error. If this is a 898 request message, the server MUST respond with a 400 (Bad Request) 899 status code and then close the connection. If this is a response 900 message received by a proxy, the proxy MUST close the connection 901 to the server, discard the received response, and send a 502 (Bad 902 Gateway) response to the client. If this is a response message 903 received by a user agent, the user agent MUST close the 904 connection to the server and discard the received response. 906 5. If a valid Content-Length header field is present without 907 Transfer-Encoding, its decimal value defines the expected message 908 body length in octets. If the sender closes the connection or 909 the recipient times out before the indicated number of octets are 910 received, the recipient MUST consider the message to be 911 incomplete and close the connection. 913 6. If this is a request message and none of the above are true, then 914 the message body length is zero (no message body is present). 916 7. Otherwise, this is a response message without a declared message 917 body length, so the message body length is determined by the 918 number of octets received prior to the server closing the 919 connection. 921 Since there is no way to distinguish a successfully completed, close- 922 delimited message from a partially received message interrupted by 923 network failure, a server SHOULD generate encoding or length- 924 delimited messages whenever possible. The close-delimiting feature 925 exists primarily for backwards compatibility with HTTP/1.0. 927 A server MAY reject a request that contains a message body but not a 928 Content-Length by responding with 411 (Length Required). 930 Unless a transfer coding other than chunked has been applied, a 931 client that sends a request containing a message body SHOULD use a 932 valid Content-Length header field if the message body length is known 933 in advance, rather than the chunked transfer coding, since some 934 existing services respond to chunked with a 411 (Length Required) 935 status code even though they understand the chunked transfer coding. 936 This is typically because such services are implemented via a gateway 937 that requires a content-length in advance of being called and the 938 server is unable or unwilling to buffer the entire request before 939 processing. 941 A user agent that sends a request containing a message body MUST send 942 a valid Content-Length header field if it does not know the server 943 will handle HTTP/1.1 (or later) requests; such knowledge can be in 944 the form of specific user configuration or by remembering the version 945 of a prior received response. 947 If the final response to the last request on a connection has been 948 completely received and there remains additional data to read, a user 949 agent MAY discard the remaining data or attempt to determine if that 950 data belongs as part of the prior response body, which might be the 951 case if the prior message's Content-Length value is incorrect. A 952 client MUST NOT process, cache, or forward such extra data as a 953 separate response, since such behavior would be vulnerable to cache 954 poisoning. 956 7. Transfer Codings 958 Transfer coding names are used to indicate an encoding transformation 959 that has been, can be, or might need to be applied to a payload body 960 in order to ensure "safe transport" through the network. This 961 differs from a content coding in that the transfer coding is a 962 property of the message rather than a property of the representation 963 that is being transferred. 965 transfer-coding = "chunked" ; Section 7.1 966 / "compress" ; [Semantics], Section 6.1.2.1 967 / "deflate" ; [Semantics], Section 6.1.2.2 968 / "gzip" ; [Semantics], Section 6.1.2.3 969 / transfer-extension 970 transfer-extension = token *( OWS ";" OWS transfer-parameter ) 972 Parameters are in the form of a name or name=value pair. 974 transfer-parameter = token BWS "=" BWS ( token / quoted-string ) 976 All transfer-coding names are case-insensitive and ought to be 977 registered within the HTTP Transfer Coding registry, as defined in 978 Section 7.3. They are used in the TE (Section 7.4) and Transfer- 979 Encoding (Section 6.1) header fields. 981 +------------+------------------------------------------+-----------+ 982 | Name | Description | Reference | 983 +------------+------------------------------------------+-----------+ 984 | chunked | Transfer in a series of chunks | Section 7 | 985 | | | .1 | 986 | compress | UNIX "compress" data format [Welch] | Section 7 | 987 | | | .2 | 988 | deflate | "deflate" compressed data ([RFC1951]) | Section 7 | 989 | | inside the "zlib" data format | .2 | 990 | | ([RFC1950]) | | 991 | gzip | GZIP file format [RFC1952] | Section 7 | 992 | | | .2 | 993 | x-compress | Deprecated (alias for compress) | Section 7 | 994 | | | .2 | 995 | x-gzip | Deprecated (alias for gzip) | Section 7 | 996 | | | .2 | 997 +------------+------------------------------------------+-----------+ 999 7.1. Chunked Transfer Coding 1001 The chunked transfer coding wraps the payload body in order to 1002 transfer it as a series of chunks, each with its own size indicator, 1003 followed by an OPTIONAL trailer containing header fields. Chunked 1004 enables content streams of unknown size to be transferred as a 1005 sequence of length-delimited buffers, which enables the sender to 1006 retain connection persistence and the recipient to know when it has 1007 received the entire message. 1009 chunked-body = *chunk 1010 last-chunk 1011 trailer-part 1012 CRLF 1014 chunk = chunk-size [ chunk-ext ] CRLF 1015 chunk-data CRLF 1016 chunk-size = 1*HEXDIG 1017 last-chunk = 1*("0") [ chunk-ext ] CRLF 1019 chunk-data = 1*OCTET ; a sequence of chunk-size octets 1021 The chunk-size field is a string of hex digits indicating the size of 1022 the chunk-data in octets. The chunked transfer coding is complete 1023 when a chunk with a chunk-size of zero is received, possibly followed 1024 by a trailer, and finally terminated by an empty line. 1026 A recipient MUST be able to parse and decode the chunked transfer 1027 coding. 1029 7.1.1. Chunk Extensions 1031 The chunked encoding allows each chunk to include zero or more chunk 1032 extensions, immediately following the chunk-size, for the sake of 1033 supplying per-chunk metadata (such as a signature or hash), mid- 1034 message control information, or randomization of message body size. 1036 chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] ) 1038 chunk-ext-name = token 1039 chunk-ext-val = token / quoted-string 1041 The chunked encoding is specific to each connection and is likely to 1042 be removed or recoded by each recipient (including intermediaries) 1043 before any higher-level application would have a chance to inspect 1044 the extensions. Hence, use of chunk extensions is generally limited 1045 to specialized HTTP services such as "long polling" (where client and 1046 server can have shared expectations regarding the use of chunk 1047 extensions) or for padding within an end-to-end secured connection. 1049 A recipient MUST ignore unrecognized chunk extensions. A server 1050 ought to limit the total length of chunk extensions received in a 1051 request to an amount reasonable for the services provided, in the 1052 same way that it applies length limitations and timeouts for other 1053 parts of a message, and generate an appropriate 4xx (Client Error) 1054 response if that amount is exceeded. 1056 7.1.2. Chunked Trailer Part 1058 A trailer allows the sender to include additional fields at the end 1059 of a chunked message in order to supply metadata that might be 1060 dynamically generated while the message body is sent, such as a 1061 message integrity check, digital signature, or post-processing 1062 status. The trailer fields are identical to header fields, except 1063 they are sent in a chunked trailer instead of the message's header 1064 section. 1066 trailer-part = *( header-field CRLF ) 1068 A sender MUST NOT generate a trailer that contains a field necessary 1069 for message framing (e.g., Transfer-Encoding and Content-Length), 1070 routing (e.g., Host), request modifiers (e.g., controls and 1071 conditionals in Section 8 of [Semantics]), authentication (e.g., see 1072 Section 8.5 of [Semantics] and [RFC6265]), response control data 1073 (e.g., see Section 10.1 of [Semantics]), or determining how to 1074 process the payload (e.g., Content-Encoding, Content-Type, Content- 1075 Range, and Trailer). 1077 When a chunked message containing a non-empty trailer is received, 1078 the recipient MAY process the fields (aside from those forbidden 1079 above) as if they were appended to the message's header section. A 1080 recipient MUST ignore (or consider as an error) any fields that are 1081 forbidden to be sent in a trailer, since processing them as if they 1082 were present in the header section might bypass external security 1083 filters. 1085 Unless the request includes a TE header field indicating "trailers" 1086 is acceptable, as described in Section 7.4, a server SHOULD NOT 1087 generate trailer fields that it believes are necessary for the user 1088 agent to receive. Without a TE containing "trailers", the server 1089 ought to assume that the trailer fields might be silently discarded 1090 along the path to the user agent. This requirement allows 1091 intermediaries to forward a de-chunked message to an HTTP/1.0 1092 recipient without buffering the entire response. 1094 When a message includes a message body encoded with the chunked 1095 transfer coding and the sender desires to send metadata in the form 1096 of trailer fields at the end of the message, the sender SHOULD 1097 generate a Trailer header field before the message body to indicate 1098 which fields will be present in the trailers. This allows the 1099 recipient to prepare for receipt of that metadata before it starts 1100 processing the body, which is useful if the message is being streamed 1101 and the recipient wishes to confirm an integrity check on the fly. 1103 7.1.3. Decoding Chunked 1105 A process for decoding the chunked transfer coding can be represented 1106 in pseudo-code as: 1108 length := 0 1109 read chunk-size, chunk-ext (if any), and CRLF 1110 while (chunk-size > 0) { 1111 read chunk-data and CRLF 1112 append chunk-data to decoded-body 1113 length := length + chunk-size 1114 read chunk-size, chunk-ext (if any), and CRLF 1115 } 1116 read trailer field 1117 while (trailer field is not empty) { 1118 if (trailer field is allowed to be sent in a trailer) { 1119 append trailer field to existing header fields 1120 } 1121 read trailer-field 1122 } 1123 Content-Length := length 1124 Remove "chunked" from Transfer-Encoding 1125 Remove Trailer from existing header fields 1127 7.2. Transfer Codings for Compression 1129 The following transfer coding names for compression are defined by 1130 the same algorithm as their corresponding content coding: 1132 compress (and x-compress) 1133 See Section 6.1.2.1 of [Semantics]. 1135 deflate 1136 See Section 6.1.2.2 of [Semantics]. 1138 gzip (and x-gzip) 1139 See Section 6.1.2.3 of [Semantics]. 1141 7.3. Transfer Coding Registry 1143 The "HTTP Transfer Coding Registry" defines the namespace for 1144 transfer coding names. It is maintained at 1145 . 1147 Registrations MUST include the following fields: 1149 o Name 1151 o Description 1153 o Pointer to specification text 1155 Names of transfer codings MUST NOT overlap with names of content 1156 codings (Section 6.1.2 of [Semantics]) unless the encoding 1157 transformation is identical, as is the case for the compression 1158 codings defined in Section 7.2. 1160 Values to be added to this namespace require IETF Review (see 1161 Section 4.1 of [RFC5226]), and MUST conform to the purpose of 1162 transfer coding defined in this specification. 1164 Use of program names for the identification of encoding formats is 1165 not desirable and is discouraged for future encodings. 1167 7.4. TE 1169 The "TE" header field in a request indicates what transfer codings, 1170 besides chunked, the client is willing to accept in response, and 1171 whether or not the client is willing to accept trailer fields in a 1172 chunked transfer coding. 1174 The TE field-value consists of a comma-separated list of transfer 1175 coding names, each allowing for optional parameters (as described in 1176 Section 7), and/or the keyword "trailers". A client MUST NOT send 1177 the chunked transfer coding name in TE; chunked is always acceptable 1178 for HTTP/1.1 recipients. 1180 TE = #t-codings 1181 t-codings = "trailers" / ( transfer-coding [ t-ranking ] ) 1182 t-ranking = OWS ";" OWS "q=" rank 1183 rank = ( "0" [ "." 0*3DIGIT ] ) 1184 / ( "1" [ "." 0*3("0") ] ) 1186 Three examples of TE use are below. 1188 TE: deflate 1189 TE: 1190 TE: trailers, deflate;q=0.5 1192 The presence of the keyword "trailers" indicates that the client is 1193 willing to accept trailer fields in a chunked transfer coding, as 1194 defined in Section 7.1.2, on behalf of itself and any downstream 1195 clients. For requests from an intermediary, this implies that 1196 either: (a) all downstream clients are willing to accept trailer 1197 fields in the forwarded response; or, (b) the intermediary will 1198 attempt to buffer the response on behalf of downstream recipients. 1199 Note that HTTP/1.1 does not define any means to limit the size of a 1200 chunked response such that an intermediary can be assured of 1201 buffering the entire response. 1203 When multiple transfer codings are acceptable, the client MAY rank 1204 the codings by preference using a case-insensitive "q" parameter 1205 (similar to the qvalues used in content negotiation fields, 1206 Section 8.4.1 of [Semantics]). The rank value is a real number in 1207 the range 0 through 1, where 0.001 is the least preferred and 1 is 1208 the most preferred; a value of 0 means "not acceptable". 1210 If the TE field-value is empty or if no TE field is present, the only 1211 acceptable transfer coding is chunked. A message with no transfer 1212 coding is always acceptable. 1214 Since the TE header field only applies to the immediate connection, a 1215 sender of TE MUST also send a "TE" connection option within the 1216 Connection header field (Section 9.1) in order to prevent the TE 1217 field from being forwarded by intermediaries that do not support its 1218 semantics. 1220 8. Handling Incomplete Messages 1222 A server that receives an incomplete request message, usually due to 1223 a canceled request or a triggered timeout exception, MAY send an 1224 error response prior to closing the connection. 1226 A client that receives an incomplete response message, which can 1227 occur when a connection is closed prematurely or when decoding a 1228 supposedly chunked transfer coding fails, MUST record the message as 1229 incomplete. Cache requirements for incomplete responses are defined 1230 in Section 3 of [Caching]. 1232 If a response terminates in the middle of the header section (before 1233 the empty line is received) and the status code might rely on header 1234 fields to convey the full meaning of the response, then the client 1235 cannot assume that meaning has been conveyed; the client might need 1236 to repeat the request in order to determine what action to take next. 1238 A message body that uses the chunked transfer coding is incomplete if 1239 the zero-sized chunk that terminates the encoding has not been 1240 received. A message that uses a valid Content-Length is incomplete 1241 if the size of the message body received (in octets) is less than the 1242 value given by Content-Length. A response that has neither chunked 1243 transfer coding nor Content-Length is terminated by closure of the 1244 connection and, thus, is considered complete regardless of the number 1245 of message body octets received, provided that the header section was 1246 received intact. 1248 9. Connection Management 1250 HTTP messaging is independent of the underlying transport- or 1251 session-layer connection protocol(s). HTTP only presumes a reliable 1252 transport with in-order delivery of requests and the corresponding 1253 in-order delivery of responses. The mapping of HTTP request and 1254 response structures onto the data units of an underlying transport 1255 protocol is outside the scope of this specification. 1257 As described in Section 5.2 of [Semantics], the specific connection 1258 protocols to be used for an HTTP interaction are determined by client 1259 configuration and the target URI. For example, the "http" URI scheme 1260 (Section 2.5.1 of [Semantics]) indicates a default connection of TCP 1261 over IP, with a default TCP port of 80, but the client might be 1262 configured to use a proxy via some other connection, port, or 1263 protocol. 1265 HTTP implementations are expected to engage in connection management, 1266 which includes maintaining the state of current connections, 1267 establishing a new connection or reusing an existing connection, 1268 processing messages received on a connection, detecting connection 1269 failures, and closing each connection. Most clients maintain 1270 multiple connections in parallel, including more than one connection 1271 per server endpoint. Most servers are designed to maintain thousands 1272 of concurrent connections, while controlling request queues to enable 1273 fair use and detect denial-of-service attacks. 1275 9.1. Connection 1277 The "Connection" header field allows the sender to indicate desired 1278 control options for the current connection. In order to avoid 1279 confusing downstream recipients, a proxy or gateway MUST remove or 1280 replace any received connection options before forwarding the 1281 message. 1283 When a header field aside from Connection is used to supply control 1284 information for or about the current connection, the sender MUST list 1285 the corresponding field-name within the Connection header field. A 1286 proxy or gateway MUST parse a received Connection header field before 1287 a message is forwarded and, for each connection-option in this field, 1288 remove any header field(s) from the message with the same name as the 1289 connection-option, and then remove the Connection header field itself 1290 (or replace it with the intermediary's own connection options for the 1291 forwarded message). 1293 Hence, the Connection header field provides a declarative way of 1294 distinguishing header fields that are only intended for the immediate 1295 recipient ("hop-by-hop") from those fields that are intended for all 1296 recipients on the chain ("end-to-end"), enabling the message to be 1297 self-descriptive and allowing future connection-specific extensions 1298 to be deployed without fear that they will be blindly forwarded by 1299 older intermediaries. 1301 The Connection header field's value has the following grammar: 1303 Connection = 1#connection-option 1304 connection-option = token 1306 Connection options are case-insensitive. 1308 A sender MUST NOT send a connection option corresponding to a header 1309 field that is intended for all recipients of the payload. For 1310 example, Cache-Control is never appropriate as a connection option 1311 (Section 5.2 of [Caching]). 1313 The connection options do not always correspond to a header field 1314 present in the message, since a connection-specific header field 1315 might not be needed if there are no parameters associated with a 1316 connection option. In contrast, a connection-specific header field 1317 that is received without a corresponding connection option usually 1318 indicates that the field has been improperly forwarded by an 1319 intermediary and ought to be ignored by the recipient. 1321 When defining new connection options, specification authors ought to 1322 survey existing header field names and ensure that the new connection 1323 option does not share the same name as an already deployed header 1324 field. Defining a new connection option essentially reserves that 1325 potential field-name for carrying additional information related to 1326 the connection option, since it would be unwise for senders to use 1327 that field-name for anything else. 1329 The "close" connection option is defined for a sender to signal that 1330 this connection will be closed after completion of the response. For 1331 example, 1333 Connection: close 1335 in either the request or the response header fields indicates that 1336 the sender is going to close the connection after the current 1337 request/response is complete (Section 9.6). 1339 A client that does not support persistent connections MUST send the 1340 "close" connection option in every request message. 1342 A server that does not support persistent connections MUST send the 1343 "close" connection option in every response message that does not 1344 have a 1xx (Informational) status code. 1346 9.2. Establishment 1348 It is beyond the scope of this specification to describe how 1349 connections are established via various transport- or session-layer 1350 protocols. Each connection applies to only one transport link. 1352 9.3. Persistence 1354 HTTP/1.1 defaults to the use of "persistent connections", allowing 1355 multiple requests and responses to be carried over a single 1356 connection. The "close" connection option is used to signal that a 1357 connection will not persist after the current request/response. HTTP 1358 implementations SHOULD support persistent connections. 1360 A recipient determines whether a connection is persistent or not 1361 based on the most recently received message's protocol version and 1362 Connection header field (if any): 1364 o If the "close" connection option is present, the connection will 1365 not persist after the current response; else, 1367 o If the received protocol is HTTP/1.1 (or later), the connection 1368 will persist after the current response; else, 1370 o If the received protocol is HTTP/1.0, the "keep-alive" connection 1371 option is present, the recipient is not a proxy, and the recipient 1372 wishes to honor the HTTP/1.0 "keep-alive" mechanism, the 1373 connection will persist after the current response; otherwise, 1375 o The connection will close after the current response. 1377 A client MAY send additional requests on a persistent connection 1378 until it sends or receives a "close" connection option or receives an 1379 HTTP/1.0 response without a "keep-alive" connection option. 1381 In order to remain persistent, all messages on a connection need to 1382 have a self-defined message length (i.e., one not defined by closure 1383 of the connection), as described in Section 6. A server MUST read 1384 the entire request message body or close the connection after sending 1385 its response, since otherwise the remaining data on a persistent 1386 connection would be misinterpreted as the next request. Likewise, a 1387 client MUST read the entire response message body if it intends to 1388 reuse the same connection for a subsequent request. 1390 A proxy server MUST NOT maintain a persistent connection with an 1391 HTTP/1.0 client (see Section 19.7.1 of [RFC2068] for information and 1392 discussion of the problems with the Keep-Alive header field 1393 implemented by many HTTP/1.0 clients). 1395 See Appendix C.1.2 for more information on backwards compatibility 1396 with HTTP/1.0 clients. 1398 9.3.1. Retrying Requests 1400 Connections can be closed at any time, with or without intention. 1401 Implementations ought to anticipate the need to recover from 1402 asynchronous close events. 1404 When an inbound connection is closed prematurely, a client MAY open a 1405 new connection and automatically retransmit an aborted sequence of 1406 requests if all of those requests have idempotent methods 1407 (Section 7.2.2 of [Semantics]). A proxy MUST NOT automatically retry 1408 non-idempotent requests. 1410 A user agent MUST NOT automatically retry a request with a non- 1411 idempotent method unless it has some means to know that the request 1412 semantics are actually idempotent, regardless of the method, or some 1413 means to detect that the original request was never applied. For 1414 example, a user agent that knows (through design or configuration) 1415 that a POST request to a given resource is safe can repeat that 1416 request automatically. Likewise, a user agent designed specifically 1417 to operate on a version control repository might be able to recover 1418 from partial failure conditions by checking the target resource 1419 revision(s) after a failed connection, reverting or fixing any 1420 changes that were partially applied, and then automatically retrying 1421 the requests that failed. 1423 A client SHOULD NOT automatically retry a failed automatic retry. 1425 9.3.2. Pipelining 1427 A client that supports persistent connections MAY "pipeline" its 1428 requests (i.e., send multiple requests without waiting for each 1429 response). A server MAY process a sequence of pipelined requests in 1430 parallel if they all have safe methods (Section 7.2.1 of 1431 [Semantics]), but it MUST send the corresponding responses in the 1432 same order that the requests were received. 1434 A client that pipelines requests SHOULD retry unanswered requests if 1435 the connection closes before it receives all of the corresponding 1436 responses. When retrying pipelined requests after a failed 1437 connection (a connection not explicitly closed by the server in its 1438 last complete response), a client MUST NOT pipeline immediately after 1439 connection establishment, since the first remaining request in the 1440 prior pipeline might have caused an error response that can be lost 1441 again if multiple requests are sent on a prematurely closed 1442 connection (see the TCP reset problem described in Section 9.6). 1444 Idempotent methods (Section 7.2.2 of [Semantics]) are significant to 1445 pipelining because they can be automatically retried after a 1446 connection failure. A user agent SHOULD NOT pipeline requests after 1447 a non-idempotent method, until the final response status code for 1448 that method has been received, unless the user agent has a means to 1449 detect and recover from partial failure conditions involving the 1450 pipelined sequence. 1452 An intermediary that receives pipelined requests MAY pipeline those 1453 requests when forwarding them inbound, since it can rely on the 1454 outbound user agent(s) to determine what requests can be safely 1455 pipelined. If the inbound connection fails before receiving a 1456 response, the pipelining intermediary MAY attempt to retry a sequence 1457 of requests that have yet to receive a response if the requests all 1458 have idempotent methods; otherwise, the pipelining intermediary 1459 SHOULD forward any received responses and then close the 1460 corresponding outbound connection(s) so that the outbound user 1461 agent(s) can recover accordingly. 1463 9.4. Concurrency 1465 A client ought to limit the number of simultaneous open connections 1466 that it maintains to a given server. 1468 Previous revisions of HTTP gave a specific number of connections as a 1469 ceiling, but this was found to be impractical for many applications. 1470 As a result, this specification does not mandate a particular maximum 1471 number of connections but, instead, encourages clients to be 1472 conservative when opening multiple connections. 1474 Multiple connections are typically used to avoid the "head-of-line 1475 blocking" problem, wherein a request that takes significant server- 1476 side processing and/or has a large payload blocks subsequent requests 1477 on the same connection. However, each connection consumes server 1478 resources. Furthermore, using multiple connections can cause 1479 undesirable side effects in congested networks. 1481 Note that a server might reject traffic that it deems abusive or 1482 characteristic of a denial-of-service attack, such as an excessive 1483 number of open connections from a single client. 1485 9.5. Failures and Timeouts 1487 Servers will usually have some timeout value beyond which they will 1488 no longer maintain an inactive connection. Proxy servers might make 1489 this a higher value since it is likely that the client will be making 1490 more connections through the same proxy server. The use of 1491 persistent connections places no requirements on the length (or 1492 existence) of this timeout for either the client or the server. 1494 A client or server that wishes to time out SHOULD issue a graceful 1495 close on the connection. Implementations SHOULD constantly monitor 1496 open connections for a received closure signal and respond to it as 1497 appropriate, since prompt closure of both sides of a connection 1498 enables allocated system resources to be reclaimed. 1500 A client, server, or proxy MAY close the transport connection at any 1501 time. For example, a client might have started to send a new request 1502 at the same time that the server has decided to close the "idle" 1503 connection. From the server's point of view, the connection is being 1504 closed while it was idle, but from the client's point of view, a 1505 request is in progress. 1507 A server SHOULD sustain persistent connections, when possible, and 1508 allow the underlying transport's flow-control mechanisms to resolve 1509 temporary overloads, rather than terminate connections with the 1510 expectation that clients will retry. The latter technique can 1511 exacerbate network congestion. 1513 A client sending a message body SHOULD monitor the network connection 1514 for an error response while it is transmitting the request. If the 1515 client sees a response that indicates the server does not wish to 1516 receive the message body and is closing the connection, the client 1517 SHOULD immediately cease transmitting the body and close its side of 1518 the connection. 1520 9.6. Tear-down 1522 The Connection header field (Section 9.1) provides a "close" 1523 connection option that a sender SHOULD send when it wishes to close 1524 the connection after the current request/response pair. 1526 A client that sends a "close" connection option MUST NOT send further 1527 requests on that connection (after the one containing "close") and 1528 MUST close the connection after reading the final response message 1529 corresponding to this request. 1531 A server that receives a "close" connection option MUST initiate a 1532 close of the connection (see below) after it sends the final response 1533 to the request that contained "close". The server SHOULD send a 1534 "close" connection option in its final response on that connection. 1535 The server MUST NOT process any further requests received on that 1536 connection. 1538 A server that sends a "close" connection option MUST initiate a close 1539 of the connection (see below) after it sends the response containing 1540 "close". The server MUST NOT process any further requests received 1541 on that connection. 1543 A client that receives a "close" connection option MUST cease sending 1544 requests on that connection and close the connection after reading 1545 the response message containing the "close"; if additional pipelined 1546 requests had been sent on the connection, the client SHOULD NOT 1547 assume that they will be processed by the server. 1549 If a server performs an immediate close of a TCP connection, there is 1550 a significant risk that the client will not be able to read the last 1551 HTTP response. If the server receives additional data from the 1552 client on a fully closed connection, such as another request that was 1553 sent by the client before receiving the server's response, the 1554 server's TCP stack will send a reset packet to the client; 1555 unfortunately, the reset packet might erase the client's 1556 unacknowledged input buffers before they can be read and interpreted 1557 by the client's HTTP parser. 1559 To avoid the TCP reset problem, servers typically close a connection 1560 in stages. First, the server performs a half-close by closing only 1561 the write side of the read/write connection. The server then 1562 continues to read from the connection until it receives a 1563 corresponding close by the client, or until the server is reasonably 1564 certain that its own TCP stack has received the client's 1565 acknowledgement of the packet(s) containing the server's last 1566 response. Finally, the server fully closes the connection. 1568 It is unknown whether the reset problem is exclusive to TCP or might 1569 also be found in other transport connection protocols. 1571 9.7. Upgrade 1573 The "Upgrade" header field is intended to provide a simple mechanism 1574 for transitioning from HTTP/1.1 to some other protocol on the same 1575 connection. A client MAY send a list of protocols in the Upgrade 1576 header field of a request to invite the server to switch to one or 1577 more of those protocols, in order of descending preference, before 1578 sending the final response. A server MAY ignore a received Upgrade 1579 header field if it wishes to continue using the current protocol on 1580 that connection. Upgrade cannot be used to insist on a protocol 1581 change. 1583 Upgrade = 1#protocol 1585 protocol = protocol-name ["/" protocol-version] 1586 protocol-name = token 1587 protocol-version = token 1589 A server that sends a 101 (Switching Protocols) response MUST send an 1590 Upgrade header field to indicate the new protocol(s) to which the 1591 connection is being switched; if multiple protocol layers are being 1592 switched, the sender MUST list the protocols in layer-ascending 1593 order. A server MUST NOT switch to a protocol that was not indicated 1594 by the client in the corresponding request's Upgrade header field. A 1595 server MAY choose to ignore the order of preference indicated by the 1596 client and select the new protocol(s) based on other factors, such as 1597 the nature of the request or the current load on the server. 1599 A server that sends a 426 (Upgrade Required) response MUST send an 1600 Upgrade header field to indicate the acceptable protocols, in order 1601 of descending preference. 1603 A server MAY send an Upgrade header field in any other response to 1604 advertise that it implements support for upgrading to the listed 1605 protocols, in order of descending preference, when appropriate for a 1606 future request. 1608 The following is a hypothetical example sent by a client: 1610 GET /hello.txt HTTP/1.1 1611 Host: www.example.com 1612 Connection: upgrade 1613 Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11 1615 The capabilities and nature of the application-level communication 1616 after the protocol change is entirely dependent upon the new 1617 protocol(s) chosen. However, immediately after sending the 101 1618 (Switching Protocols) response, the server is expected to continue 1619 responding to the original request as if it had received its 1620 equivalent within the new protocol (i.e., the server still has an 1621 outstanding request to satisfy after the protocol has been changed, 1622 and is expected to do so without requiring the request to be 1623 repeated). 1625 For example, if the Upgrade header field is received in a GET request 1626 and the server decides to switch protocols, it first responds with a 1627 101 (Switching Protocols) message in HTTP/1.1 and then immediately 1628 follows that with the new protocol's equivalent of a response to a 1629 GET on the target resource. This allows a connection to be upgraded 1630 to protocols with the same semantics as HTTP without the latency cost 1631 of an additional round trip. A server MUST NOT switch protocols 1632 unless the received message semantics can be honored by the new 1633 protocol; an OPTIONS request can be honored by any protocol. 1635 The following is an example response to the above hypothetical 1636 request: 1638 HTTP/1.1 101 Switching Protocols 1639 Connection: upgrade 1640 Upgrade: HTTP/2.0 1642 [... data stream switches to HTTP/2.0 with an appropriate response 1643 (as defined by new protocol) to the "GET /hello.txt" request ...] 1645 When Upgrade is sent, the sender MUST also send a Connection header 1646 field (Section 9.1) that contains an "upgrade" connection option, in 1647 order to prevent Upgrade from being accidentally forwarded by 1648 intermediaries that might not implement the listed protocols. A 1649 server MUST ignore an Upgrade header field that is received in an 1650 HTTP/1.0 request. 1652 A client cannot begin using an upgraded protocol on the connection 1653 until it has completely sent the request message (i.e., the client 1654 can't change the protocol it is sending in the middle of a message). 1655 If a server receives both an Upgrade and an Expect header field with 1656 the "100-continue" expectation (Section 8.1.1 of [Semantics]), the 1657 server MUST send a 100 (Continue) response before sending a 101 1658 (Switching Protocols) response. 1660 The Upgrade header field only applies to switching protocols on top 1661 of the existing connection; it cannot be used to switch the 1662 underlying connection (transport) protocol, nor to switch the 1663 existing communication to a different connection. For those 1664 purposes, it is more appropriate to use a 3xx (Redirection) response 1665 (Section 9.4 of [Semantics]). 1667 9.7.1. Upgrade Protocol Names 1669 This specification only defines the protocol name "HTTP" for use by 1670 the family of Hypertext Transfer Protocols, as defined by the HTTP 1671 version rules of Section 3.5 of [Semantics] and future updates to 1672 this specification. Additional protocol names ought to be registered 1673 using the registration procedure defined in Section 9.7.2. 1675 +------+-------------------+--------------------+-------------------+ 1676 | Name | Description | Expected Version | Reference | 1677 | | | Tokens | | 1678 +------+-------------------+--------------------+-------------------+ 1679 | HTTP | Hypertext | any DIGIT.DIGIT | Section 3.5 of | 1680 | | Transfer Protocol | (e.g, "2.0") | [Semantics] | 1681 +------+-------------------+--------------------+-------------------+ 1683 9.7.2. Upgrade Token Registry 1685 The "Hypertext Transfer Protocol (HTTP) Upgrade Token Registry" 1686 defines the namespace for protocol-name tokens used to identify 1687 protocols in the Upgrade header field. The registry is maintained at 1688 . 1690 Each registered protocol name is associated with contact information 1691 and an optional set of specifications that details how the connection 1692 will be processed after it has been upgraded. 1694 Registrations happen on a "First Come First Served" basis (see 1695 Section 4.1 of [RFC5226]) and are subject to the following rules: 1697 1. A protocol-name token, once registered, stays registered forever. 1699 2. The registration MUST name a responsible party for the 1700 registration. 1702 3. The registration MUST name a point of contact. 1704 4. The registration MAY name a set of specifications associated with 1705 that token. Such specifications need not be publicly available. 1707 5. The registration SHOULD name a set of expected "protocol-version" 1708 tokens associated with that token at the time of registration. 1710 6. The responsible party MAY change the registration at any time. 1711 The IANA will keep a record of all such changes, and make them 1712 available upon request. 1714 7. The IESG MAY reassign responsibility for a protocol token. This 1715 will normally only be used in the case when a responsible party 1716 cannot be contacted. 1718 10. Enclosing Messages as Data 1720 10.1. Media Type message/http 1722 The message/http media type can be used to enclose a single HTTP 1723 request or response message, provided that it obeys the MIME 1724 restrictions for all "message" types regarding line length and 1725 encodings. 1727 Type name: message 1729 Subtype name: http 1731 Required parameters: N/A 1733 Optional parameters: version, msgtype 1735 version: The HTTP-version number of the enclosed message (e.g., 1736 "1.1"). If not present, the version can be determined from the 1737 first line of the body. 1739 msgtype: The message type -- "request" or "response". If not 1740 present, the type can be determined from the first line of the 1741 body. 1743 Encoding considerations: only "7bit", "8bit", or "binary" are 1744 permitted 1746 Security considerations: see Section 11 1748 Interoperability considerations: N/A 1750 Published specification: This specification (see Section 10.1). 1752 Applications that use this media type: N/A 1754 Fragment identifier considerations: N/A 1756 Additional information: 1758 Magic number(s): N/A 1760 Deprecated alias names for this type: N/A 1762 File extension(s): N/A 1764 Macintosh file type code(s): N/A 1766 Person and email address to contact for further information: 1767 See Authors' Addresses section. 1769 Intended usage: COMMON 1771 Restrictions on usage: N/A 1773 Author: See Authors' Addresses section. 1775 Change controller: IESG 1777 10.2. Media Type application/http 1779 The application/http media type can be used to enclose a pipeline of 1780 one or more HTTP request or response messages (not intermixed). 1782 Type name: application 1784 Subtype name: http 1786 Required parameters: N/A 1788 Optional parameters: version, msgtype 1790 version: The HTTP-version number of the enclosed messages (e.g., 1791 "1.1"). If not present, the version can be determined from the 1792 first line of the body. 1794 msgtype: The message type -- "request" or "response". If not 1795 present, the type can be determined from the first line of the 1796 body. 1798 Encoding considerations: HTTP messages enclosed by this type are in 1799 "binary" format; use of an appropriate Content-Transfer-Encoding 1800 is required when transmitted via email. 1802 Security considerations: see Section 11 1804 Interoperability considerations: N/A 1805 Published specification: This specification (see Section 10.2). 1807 Applications that use this media type: N/A 1809 Fragment identifier considerations: N/A 1811 Additional information: 1813 Deprecated alias names for this type: N/A 1815 Magic number(s): N/A 1817 File extension(s): N/A 1819 Macintosh file type code(s): N/A 1821 Person and email address to contact for further information: 1822 See Authors' Addresses section. 1824 Intended usage: COMMON 1826 Restrictions on usage: N/A 1828 Author: See Authors' Addresses section. 1830 Change controller: IESG 1832 11. Security Considerations 1834 This section is meant to inform developers, information providers, 1835 and users of known security considerations relevant to HTTP message 1836 syntax, parsing, and routing. Security considerations about HTTP 1837 semantics and payloads are addressed in [Semantics]. 1839 11.1. Response Splitting 1841 Response splitting (a.k.a, CRLF injection) is a common technique, 1842 used in various attacks on Web usage, that exploits the line-based 1843 nature of HTTP message framing and the ordered association of 1844 requests to responses on persistent connections [Klein]. This 1845 technique can be particularly damaging when the requests pass through 1846 a shared cache. 1848 Response splitting exploits a vulnerability in servers (usually 1849 within an application server) where an attacker can send encoded data 1850 within some parameter of the request that is later decoded and echoed 1851 within any of the response header fields of the response. If the 1852 decoded data is crafted to look like the response has ended and a 1853 subsequent response has begun, the response has been split and the 1854 content within the apparent second response is controlled by the 1855 attacker. The attacker can then make any other request on the same 1856 persistent connection and trick the recipients (including 1857 intermediaries) into believing that the second half of the split is 1858 an authoritative answer to the second request. 1860 For example, a parameter within the request-target might be read by 1861 an application server and reused within a redirect, resulting in the 1862 same parameter being echoed in the Location header field of the 1863 response. If the parameter is decoded by the application and not 1864 properly encoded when placed in the response field, the attacker can 1865 send encoded CRLF octets and other content that will make the 1866 application's single response look like two or more responses. 1868 A common defense against response splitting is to filter requests for 1869 data that looks like encoded CR and LF (e.g., "%0D" and "%0A"). 1870 However, that assumes the application server is only performing URI 1871 decoding, rather than more obscure data transformations like charset 1872 transcoding, XML entity translation, base64 decoding, sprintf 1873 reformatting, etc. A more effective mitigation is to prevent 1874 anything other than the server's core protocol libraries from sending 1875 a CR or LF within the header section, which means restricting the 1876 output of header fields to APIs that filter for bad octets and not 1877 allowing application servers to write directly to the protocol 1878 stream. 1880 11.2. Request Smuggling 1882 Request smuggling ([Linhart]) is a technique that exploits 1883 differences in protocol parsing among various recipients to hide 1884 additional requests (which might otherwise be blocked or disabled by 1885 policy) within an apparently harmless request. Like response 1886 splitting, request smuggling can lead to a variety of attacks on HTTP 1887 usage. 1889 This specification has introduced new requirements on request 1890 parsing, particularly with regard to message framing in Section 6.3, 1891 to reduce the effectiveness of request smuggling. 1893 11.3. Message Integrity 1895 HTTP does not define a specific mechanism for ensuring message 1896 integrity, instead relying on the error-detection ability of 1897 underlying transport protocols and the use of length or chunk- 1898 delimited framing to detect completeness. Additional integrity 1899 mechanisms, such as hash functions or digital signatures applied to 1900 the content, can be selectively added to messages via extensible 1901 metadata header fields. Historically, the lack of a single integrity 1902 mechanism has been justified by the informal nature of most HTTP 1903 communication. However, the prevalence of HTTP as an information 1904 access mechanism has resulted in its increasing use within 1905 environments where verification of message integrity is crucial. 1907 User agents are encouraged to implement configurable means for 1908 detecting and reporting failures of message integrity such that those 1909 means can be enabled within environments for which integrity is 1910 necessary. For example, a browser being used to view medical history 1911 or drug interaction information needs to indicate to the user when 1912 such information is detected by the protocol to be incomplete, 1913 expired, or corrupted during transfer. Such mechanisms might be 1914 selectively enabled via user agent extensions or the presence of 1915 message integrity metadata in a response. At a minimum, user agents 1916 ought to provide some indication that allows a user to distinguish 1917 between a complete and incomplete response message (Section 8) when 1918 such verification is desired. 1920 11.4. Message Confidentiality 1922 HTTP relies on underlying transport protocols to provide message 1923 confidentiality when that is desired. HTTP has been specifically 1924 designed to be independent of the transport protocol, such that it 1925 can be used over many different forms of encrypted connection, with 1926 the selection of such transports being identified by the choice of 1927 URI scheme or within user agent configuration. 1929 The "https" scheme can be used to identify resources that require a 1930 confidential connection, as described in Section 2.5.2 of 1931 [Semantics]. 1933 12. IANA Considerations 1935 This section is to be removed before publishing as an RFC. 1937 The change controller for the following registrations is: "IETF 1938 (iesg@ietf.org) - Internet Engineering Task Force". 1940 12.1. Header Field Registration 1942 Please update the "Message Headers" registry of "Permanent Message 1943 Header Field Names" at with the header field names listed in the two tables of 1945 Section 5. 1947 12.2. Media Type Registration 1949 Please update the "Media Types" registry at 1950 with the registration 1951 information in Section 10.1 and Section 10.2 for the media types 1952 "message/http" and "application/http", respectively. 1954 12.3. Transfer Coding Registration 1956 Please update the "HTTP Transfer Coding Registry" at 1957 with the 1958 registration procedure of Section 7.3 and the content coding names 1959 summarized in the table of Section 7. 1961 12.4. Upgrade Token Registration 1963 Please update the "Hypertext Transfer Protocol (HTTP) Upgrade Token 1964 Registry" at 1965 with the registration procedure of Section 9.7.2 and the upgrade 1966 token names summarized in the table of Section 9.7.1. 1968 13. References 1970 13.1. Normative References 1972 [Caching] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, 1973 Ed., "HTTP Caching", draft-ietf-httpbis-cache-01 (work in 1974 progress), May 2018. 1976 [RFC1950] Deutsch, L. and J-L. Gailly, "ZLIB Compressed Data Format 1977 Specification version 3.3", RFC 1950, 1978 DOI 10.17487/RFC1950, May 1996, 1979 . 1981 [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification 1982 version 1.3", RFC 1951, DOI 10.17487/RFC1951, May 1996, 1983 . 1985 [RFC1952] Deutsch, P., Gailly, J-L., Adler, M., Deutsch, L., and G. 1986 Randers-Pehrson, "GZIP file format specification version 1987 4.3", RFC 1952, DOI 10.17487/RFC1952, May 1996, 1988 . 1990 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1991 Requirement Levels", BCP 14, RFC 2119, 1992 DOI 10.17487/RFC2119, March 1997, 1993 . 1995 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1996 Resource Identifier (URI): Generic Syntax", STD 66, 1997 RFC 3986, DOI 10.17487/RFC3986, January 2005, 1998 . 2000 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 2001 Specifications: ABNF", STD 68, RFC 5234, 2002 DOI 10.17487/RFC5234, January 2008, 2003 . 2005 [Semantics] 2006 Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, 2007 Ed., "HTTP Semantics", draft-ietf-httpbis-semantics-01 2008 (work in progress), May 2018. 2010 [USASCII] American National Standards Institute, "Coded Character 2011 Set -- 7-bit American Standard Code for Information 2012 Interchange", ANSI X3.4, 1986. 2014 [Welch] Welch, T., "A Technique for High-Performance Data 2015 Compression", IEEE Computer 17(6), June 1984. 2017 13.2. Informative References 2019 [Klein] Klein, A., "Divide and Conquer - HTTP Response Splitting, 2020 Web Cache Poisoning Attacks, and Related Topics", March 2021 2004, . 2024 [Linhart] Linhart, C., Klein, A., Heled, R., and S. Orrin, "HTTP 2025 Request Smuggling", June 2005, 2026 . 2028 [RFC1945] Berners-Lee, T., Fielding, R., and H. Nielsen, "Hypertext 2029 Transfer Protocol -- HTTP/1.0", RFC 1945, 2030 DOI 10.17487/RFC1945, May 1996, 2031 . 2033 [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2034 Extensions (MIME) Part One: Format of Internet Message 2035 Bodies", RFC 2045, DOI 10.17487/RFC2045, November 1996, 2036 . 2038 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2039 Extensions (MIME) Part Two: Media Types", RFC 2046, 2040 DOI 10.17487/RFC2046, November 1996, 2041 . 2043 [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2044 Extensions (MIME) Part Five: Conformance Criteria and 2045 Examples", RFC 2049, DOI 10.17487/RFC2049, November 1996, 2046 . 2048 [RFC2068] Fielding, R., Gettys, J., Mogul, J., Nielsen, H., and T. 2049 Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", 2050 RFC 2068, DOI 10.17487/RFC2068, January 1997, 2051 . 2053 [RFC2557] Palme, F., Hopmann, A., Shelness, N., and E. Stefferud, 2054 "MIME Encapsulation of Aggregate Documents, such as HTML 2055 (MHTML)", RFC 2557, DOI 10.17487/RFC2557, March 1999, 2056 . 2058 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 2059 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 2060 DOI 10.17487/RFC5226, May 2008, 2061 . 2063 [RFC5322] Resnick, P., "Internet Message Format", RFC 5322, 2064 DOI 10.17487/RFC5322, October 2008, 2065 . 2067 [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, 2068 DOI 10.17487/RFC6265, April 2011, 2069 . 2071 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2072 Protocol (HTTP/1.1): Message Syntax and Routing", 2073 RFC 7230, DOI 10.17487/RFC7230, June 2014, 2074 . 2076 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2077 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 2078 DOI 10.17487/RFC7231, June 2014, 2079 . 2081 Appendix A. Collected ABNF 2083 In the collected ABNF below, list rules are expanded as per 2084 Section 11 of [Semantics]. 2086 BWS = 2088 Connection = *( "," OWS ) connection-option *( OWS "," [ OWS 2089 connection-option ] ) 2091 HTTP-message = start-line *( header-field CRLF ) CRLF [ message-body 2092 ] 2093 HTTP-name = %x48.54.54.50 ; HTTP 2094 HTTP-version = HTTP-name "/" DIGIT "." DIGIT 2096 OWS = 2098 RWS = 2100 TE = [ ( "," / t-codings ) *( OWS "," [ OWS t-codings ] ) ] 2101 Transfer-Encoding = *( "," OWS ) transfer-coding *( OWS "," [ OWS 2102 transfer-coding ] ) 2104 Upgrade = *( "," OWS ) protocol *( OWS "," [ OWS protocol ] ) 2106 absolute-URI = 2107 absolute-form = absolute-URI 2108 absolute-path = 2109 asterisk-form = "*" 2110 authority = 2111 authority-form = authority 2113 chunk = chunk-size [ chunk-ext ] CRLF chunk-data CRLF 2114 chunk-data = 1*OCTET 2115 chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] ) 2116 chunk-ext-name = token 2117 chunk-ext-val = token / quoted-string 2118 chunk-size = 1*HEXDIG 2119 chunked-body = *chunk last-chunk trailer-part CRLF 2120 comment = 2121 connection-option = token 2123 field-name = 2124 field-value = 2126 header-field = field-name ":" OWS field-value OWS 2128 last-chunk = 1*"0" [ chunk-ext ] CRLF 2129 message-body = *OCTET 2130 method = token 2132 obs-fold = CRLF 1*( SP / HTAB ) 2133 obs-text = 2134 origin-form = absolute-path [ "?" query ] 2136 port = 2137 protocol = protocol-name [ "/" protocol-version ] 2138 protocol-name = token 2139 protocol-version = token 2141 query = 2142 quoted-string = 2144 rank = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] ) 2145 reason-phrase = *( HTAB / SP / VCHAR / obs-text ) 2146 request-line = method SP request-target SP HTTP-version CRLF 2147 request-target = origin-form / absolute-form / authority-form / 2148 asterisk-form 2150 start-line = request-line / status-line 2151 status-code = 3DIGIT 2152 status-line = HTTP-version SP status-code SP reason-phrase CRLF 2154 t-codings = "trailers" / ( transfer-coding [ t-ranking ] ) 2155 t-ranking = OWS ";" OWS "q=" rank 2156 token = 2157 trailer-part = *( header-field CRLF ) 2158 transfer-coding = "chunked" / "compress" / "deflate" / "gzip" / 2159 transfer-extension 2160 transfer-extension = token *( OWS ";" OWS transfer-parameter ) 2161 transfer-parameter = token BWS "=" BWS ( token / quoted-string ) 2163 uri-host = 2165 Appendix B. Differences between HTTP and MIME 2167 HTTP/1.1 uses many of the constructs defined for the Internet Message 2168 Format [RFC5322] and the Multipurpose Internet Mail Extensions (MIME) 2169 [RFC2045] to allow a message body to be transmitted in an open 2170 variety of representations and with extensible header fields. 2171 However, RFC 2045 is focused only on email; applications of HTTP have 2172 many characteristics that differ from email; hence, HTTP has features 2173 that differ from MIME. These differences were carefully chosen to 2174 optimize performance over binary connections, to allow greater 2175 freedom in the use of new media types, to make date comparisons 2176 easier, and to acknowledge the practice of some early HTTP servers 2177 and clients. 2179 This appendix describes specific areas where HTTP differs from MIME. 2180 Proxies and gateways to and from strict MIME environments need to be 2181 aware of these differences and provide the appropriate conversions 2182 where necessary. 2184 B.1. MIME-Version 2186 HTTP is not a MIME-compliant protocol. However, messages can include 2187 a single MIME-Version header field to indicate what version of the 2188 MIME protocol was used to construct the message. Use of the MIME- 2189 Version header field indicates that the message is in full 2190 conformance with the MIME protocol (as defined in [RFC2045]). 2191 Senders are responsible for ensuring full conformance (where 2192 possible) when exporting HTTP messages to strict MIME environments. 2194 B.2. Conversion to Canonical Form 2196 MIME requires that an Internet mail body part be converted to 2197 canonical form prior to being transferred, as described in Section 4 2198 of [RFC2049]. Section 6.1.1.2 of [Semantics] describes the forms 2199 allowed for subtypes of the "text" media type when transmitted over 2200 HTTP. [RFC2046] requires that content with a type of "text" 2201 represent line breaks as CRLF and forbids the use of CR or LF outside 2202 of line break sequences. HTTP allows CRLF, bare CR, and bare LF to 2203 indicate a line break within text content. 2205 A proxy or gateway from HTTP to a strict MIME environment ought to 2206 translate all line breaks within text media types to the RFC 2049 2207 canonical form of CRLF. Note, however, this might be complicated by 2208 the presence of a Content-Encoding and by the fact that HTTP allows 2209 the use of some charsets that do not use octets 13 and 10 to 2210 represent CR and LF, respectively. 2212 Conversion will break any cryptographic checksums applied to the 2213 original content unless the original content is already in canonical 2214 form. Therefore, the canonical form is recommended for any content 2215 that uses such checksums in HTTP. 2217 B.3. Conversion of Date Formats 2219 HTTP/1.1 uses a restricted set of date formats (Section 10.1.1.1 of 2220 [Semantics]) to simplify the process of date comparison. Proxies and 2221 gateways from other protocols ought to ensure that any Date header 2222 field present in a message conforms to one of the HTTP/1.1 formats 2223 and rewrite the date if necessary. 2225 B.4. Conversion of Content-Encoding 2227 MIME does not include any concept equivalent to HTTP/1.1's Content- 2228 Encoding header field. Since this acts as a modifier on the media 2229 type, proxies and gateways from HTTP to MIME-compliant protocols 2230 ought to either change the value of the Content-Type header field or 2231 decode the representation before forwarding the message. (Some 2232 experimental applications of Content-Type for Internet mail have used 2233 a media-type parameter of ";conversions=" to perform 2234 a function equivalent to Content-Encoding. However, this parameter 2235 is not part of the MIME standards). 2237 B.5. Conversion of Content-Transfer-Encoding 2239 HTTP does not use the Content-Transfer-Encoding field of MIME. 2240 Proxies and gateways from MIME-compliant protocols to HTTP need to 2241 remove any Content-Transfer-Encoding prior to delivering the response 2242 message to an HTTP client. 2244 Proxies and gateways from HTTP to MIME-compliant protocols are 2245 responsible for ensuring that the message is in the correct format 2246 and encoding for safe transport on that protocol, where "safe 2247 transport" is defined by the limitations of the protocol being used. 2248 Such a proxy or gateway ought to transform and label the data with an 2249 appropriate Content-Transfer-Encoding if doing so will improve the 2250 likelihood of safe transport over the destination protocol. 2252 B.6. MHTML and Line Length Limitations 2254 HTTP implementations that share code with MHTML [RFC2557] 2255 implementations need to be aware of MIME line length limitations. 2256 Since HTTP does not have this limitation, HTTP does not fold long 2257 lines. MHTML messages being transported by HTTP follow all 2258 conventions of MHTML, including line length limitations and folding, 2259 canonicalization, etc., since HTTP transfers message-bodies as 2260 payload and, aside from the "multipart/byteranges" type 2261 (Section 6.3.4 of [Semantics]), does not interpret the content or any 2262 MIME header lines that might be contained therein. 2264 Appendix C. HTTP Version History 2266 HTTP has been in use since 1990. The first version, later referred 2267 to as HTTP/0.9, was a simple protocol for hypertext data transfer 2268 across the Internet, using only a single request method (GET) and no 2269 metadata. HTTP/1.0, as defined by [RFC1945], added a range of 2270 request methods and MIME-like messaging, allowing for metadata to be 2271 transferred and modifiers placed on the request/response semantics. 2272 However, HTTP/1.0 did not sufficiently take into consideration the 2273 effects of hierarchical proxies, caching, the need for persistent 2274 connections, or name-based virtual hosts. The proliferation of 2275 incompletely implemented applications calling themselves "HTTP/1.0" 2276 further necessitated a protocol version change in order for two 2277 communicating applications to determine each other's true 2278 capabilities. 2280 HTTP/1.1 remains compatible with HTTP/1.0 by including more stringent 2281 requirements that enable reliable implementations, adding only those 2282 features that can either be safely ignored by an HTTP/1.0 recipient 2283 or only be sent when communicating with a party advertising 2284 conformance with HTTP/1.1. 2286 HTTP/1.1 has been designed to make supporting previous versions easy. 2287 A general-purpose HTTP/1.1 server ought to be able to understand any 2288 valid request in the format of HTTP/1.0, responding appropriately 2289 with an HTTP/1.1 message that only uses features understood (or 2290 safely ignored) by HTTP/1.0 clients. Likewise, an HTTP/1.1 client 2291 can be expected to understand any valid HTTP/1.0 response. 2293 Since HTTP/0.9 did not support header fields in a request, there is 2294 no mechanism for it to support name-based virtual hosts (selection of 2295 resource by inspection of the Host header field). Any server that 2296 implements name-based virtual hosts ought to disable support for 2297 HTTP/0.9. Most requests that appear to be HTTP/0.9 are, in fact, 2298 badly constructed HTTP/1.x requests caused by a client failing to 2299 properly encode the request-target. 2301 C.1. Changes from HTTP/1.0 2303 This section summarizes major differences between versions HTTP/1.0 2304 and HTTP/1.1. 2306 C.1.1. Multihomed Web Servers 2308 The requirements that clients and servers support the Host header 2309 field (Section 5.4 of [Semantics]), report an error if it is missing 2310 from an HTTP/1.1 request, and accept absolute URIs (Section 3.2) are 2311 among the most important changes defined by HTTP/1.1. 2313 Older HTTP/1.0 clients assumed a one-to-one relationship of IP 2314 addresses and servers; there was no other established mechanism for 2315 distinguishing the intended server of a request than the IP address 2316 to which that request was directed. The Host header field was 2317 introduced during the development of HTTP/1.1 and, though it was 2318 quickly implemented by most HTTP/1.0 browsers, additional 2319 requirements were placed on all HTTP/1.1 requests in order to ensure 2320 complete adoption. At the time of this writing, most HTTP-based 2321 services are dependent upon the Host header field for targeting 2322 requests. 2324 C.1.2. Keep-Alive Connections 2326 In HTTP/1.0, each connection is established by the client prior to 2327 the request and closed by the server after sending the response. 2328 However, some implementations implement the explicitly negotiated 2329 ("Keep-Alive") version of persistent connections described in 2330 Section 19.7.1 of [RFC2068]. 2332 Some clients and servers might wish to be compatible with these 2333 previous approaches to persistent connections, by explicitly 2334 negotiating for them with a "Connection: keep-alive" request header 2335 field. However, some experimental implementations of HTTP/1.0 2336 persistent connections are faulty; for example, if an HTTP/1.0 proxy 2337 server doesn't understand Connection, it will erroneously forward 2338 that header field to the next inbound server, which would result in a 2339 hung connection. 2341 One attempted solution was the introduction of a Proxy-Connection 2342 header field, targeted specifically at proxies. In practice, this 2343 was also unworkable, because proxies are often deployed in multiple 2344 layers, bringing about the same problem discussed above. 2346 As a result, clients are encouraged not to send the Proxy-Connection 2347 header field in any requests. 2349 Clients are also encouraged to consider the use of Connection: keep- 2350 alive in requests carefully; while they can enable persistent 2351 connections with HTTP/1.0 servers, clients using them will need to 2352 monitor the connection for "hung" requests (which indicate that the 2353 client ought stop sending the header field), and this mechanism ought 2354 not be used by clients at all when a proxy is being used. 2356 C.1.3. Introduction of Transfer-Encoding 2358 HTTP/1.1 introduces the Transfer-Encoding header field (Section 6.1). 2359 Transfer codings need to be decoded prior to forwarding an HTTP 2360 message over a MIME-compliant protocol. 2362 C.2. Changes from RFC 7230 2364 Most of the sections introducing HTTP's design goals, history, 2365 architecture, conformance criteria, protocol versioning, URIs, 2366 message routing, and header field values have been moved to 2367 [Semantics]. This document has been reduced to just the messaging 2368 syntax and connection management requirements specific to HTTP/1.1. 2370 Appendix D. Change Log 2372 This section is to be removed before publishing as an RFC. 2374 D.1. Between RFC7230 and draft 00 2376 The changes were purely editorial: 2378 o Change boilerplate and abstract to indicate the "draft" status, 2379 and update references to ancestor specifications. 2381 o Adjust historical notes. 2383 o Update links to sibling specifications. 2385 o Replace sections listing changes from RFC 2616 by new empty 2386 sections referring to RFC 723x. 2388 o Remove acknowledgements specific to RFC 723x. 2390 o Move "Acknowledgements" to the very end and make them unnumbered. 2392 D.2. Since draft-ietf-httpbis-messaging-00 2394 The changes in this draft are editorial, with respect to HTTP as a 2395 whole, to move all core HTTP semantics into [Semantics]: 2397 o Moved introduction, architecture, conformance, and ABNF extensions 2398 from RFC 7230 (Messaging) to semantics [Semantics]. 2400 o Moved discussion of MIME differences from RFC 7231 (Semantics) to 2401 Appendix B since they mostly cover transforming 1.1 messages. 2403 o Moved all extensibility tips, registration procedures, and 2404 registry tables from the IANA considerations to normative 2405 sections, reducing the IANA considerations to just instructions 2406 that will be removed prior to publication as an RFC. 2408 Index 2410 A 2411 absolute-form (of request-target) 10 2412 application/http Media Type 38 2413 asterisk-form (of request-target) 11 2414 authority-form (of request-target) 11 2416 C 2417 Connection header field 27, 33 2418 Content-Length header field 18 2419 Content-Transfer-Encoding header field 48 2420 chunked (Coding Format) 17, 19 2421 chunked (transfer coding) 22 2422 close 27, 33 2423 compress (transfer coding) 24 2425 D 2426 deflate (transfer coding) 24 2428 E 2429 effective request URI 12 2431 G 2432 Grammar 2433 absolute-form 9-10 2434 ALPHA 5 2435 asterisk-form 9, 11 2436 authority-form 9, 11 2437 chunk 22 2438 chunk-data 22 2439 chunk-ext 22 2440 chunk-ext-name 22 2441 chunk-ext-val 22 2442 chunk-size 22 2443 chunked-body 22 2444 Connection 28 2445 connection-option 28 2446 CR 5 2447 CRLF 5 2448 CTL 5 2449 DIGIT 5 2450 DQUOTE 5 2451 field-name 14 2452 field-value 14 2453 header-field 14, 23 2454 HEXDIG 5 2455 HTAB 5 2456 HTTP-message 6 2457 HTTP-name 6 2458 HTTP-version 6 2459 last-chunk 22 2460 LF 5 2461 message-body 16 2462 method 9 2463 obs-fold 15 2464 OCTET 5 2465 origin-form 9-10 2466 rank 25 2467 reason-phrase 14 2468 request-line 8 2469 request-target 9 2470 SP 5 2471 start-line 6 2472 status-code 14 2473 status-line 13 2474 t-codings 25 2475 t-ranking 25 2476 TE 25 2477 trailer-part 22-23 2478 transfer-coding 21 2479 Transfer-Encoding 17 2480 transfer-extension 21 2481 transfer-parameter 21 2482 Upgrade 34 2483 VCHAR 5 2484 gzip (transfer coding) 24 2486 H 2487 header field 6 2488 header section 6 2489 headers 6 2491 M 2492 MIME-Version header field 47 2493 Media Type 2494 application/http 38 2495 message/http 37 2496 message/http Media Type 37 2497 method 9 2499 O 2500 origin-form (of request-target) 10 2502 R 2503 request-target 9 2505 T 2506 TE header field 25 2507 Transfer-Encoding header field 17 2509 U 2510 Upgrade header field 34 2512 X 2513 x-compress (transfer coding) 24 2514 x-gzip (transfer coding) 24 2516 Acknowledgments 2518 See Appendix "Acknowledgments" of [Semantics]. 2520 Authors' Addresses 2522 Roy T. Fielding (editor) 2523 Adobe 2524 345 Park Ave 2525 San Jose, CA 95110 2526 USA 2528 EMail: fielding@gbiv.com 2529 URI: https://roy.gbiv.com/ 2531 Mark Nottingham (editor) 2532 Fastly 2534 EMail: mnot@mnot.net 2535 URI: https://www.mnot.net/ 2537 Julian F. Reschke (editor) 2538 greenbytes GmbH 2539 Hafenweg 16 2540 Muenster, NW 48155 2541 Germany 2543 EMail: julian.reschke@greenbytes.de 2544 URI: https://greenbytes.de/tech/webdav/