source: draft-ietf-httpbis/22/draft-ietf-httpbis-p1-messaging-22.xml @ 2561

Last change on this file since 2561 was 2190, checked in by julian.reschke@…, 7 years ago

prepare -22 for release

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 210.1 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3    This XML document is the output of clean-for-DTD.xslt; a tool that strips
4    extensions to RFC2629(bis) from documents for processing with xml2rfc.
5-->
6<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
7<?rfc toc="yes" ?>
8<?rfc symrefs="yes" ?>
9<?rfc sortrefs="yes" ?>
10<?rfc compact="yes"?>
11<?rfc subcompact="no" ?>
12<?rfc linkmailto="no" ?>
13<?rfc editing="no" ?>
14<?rfc comments="yes"?>
15<?rfc inline="yes"?>
16<?rfc rfcedstyle="yes"?>
17<!DOCTYPE rfc
18  PUBLIC "" "rfc2629.dtd">
19<rfc obsoletes="2145,2616" updates="2817,2818" category="std" ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p1-messaging-22">
20
21
22<front>
23
24  <title abbrev="HTTP/1.1 Message Syntax and Routing">Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
25
26  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
27    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
28    <address>
29      <postal>
30        <street>345 Park Ave</street>
31        <city>San Jose</city>
32        <region>CA</region>
33        <code>95110</code>
34        <country>USA</country>
35      </postal>
36      <email>fielding@gbiv.com</email>
37      <uri>http://roy.gbiv.com/</uri>
38    </address>
39  </author>
40
41  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
42    <organization abbrev="greenbytes">greenbytes GmbH</organization>
43    <address>
44      <postal>
45        <street>Hafenweg 16</street>
46        <city>Muenster</city><region>NW</region><code>48155</code>
47        <country>Germany</country>
48      </postal>
49      <email>julian.reschke@greenbytes.de</email>
50      <uri>http://greenbytes.de/tech/webdav/</uri>
51    </address>
52  </author>
53
54  <date month="February" year="2013" day="23"/>
55  <workgroup>HTTPbis Working Group</workgroup>
56
57<abstract>
58<t>
59   The Hypertext Transfer Protocol (HTTP) is an application-level protocol for
60   distributed, collaborative, hypertext information systems. HTTP has been in
61   use by the World Wide Web global information initiative since 1990.
62   This document provides an overview of HTTP architecture and its associated
63   terminology, defines the "http" and "https" Uniform Resource Identifier
64   (URI) schemes, defines the HTTP/1.1 message syntax and parsing requirements,
65   and describes general security concerns for implementations.
66</t>   
67</abstract>
68
69<note title="Editorial Note (To be removed by RFC Editor)">
70  <t>
71    Discussion of this draft takes place on the HTTPBIS working group
72    mailing list (ietf-http-wg@w3.org), which is archived at
73    <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
74  </t>
75  <t>
76    The current issues list is at
77    <eref target="http://tools.ietf.org/wg/httpbis/trac/report/3"/> and related
78    documents (including fancy diffs) can be found at
79    <eref target="http://tools.ietf.org/wg/httpbis/"/>.
80  </t>
81  <t>
82    The changes in this draft are summarized in <xref target="changes.since.21"/>.
83  </t>
84</note>
85</front>
86<middle>
87<section title="Introduction" anchor="introduction">
88<t>
89   The Hypertext Transfer Protocol (HTTP) is an application-level
90   request/response protocol that uses extensible semantics and self-descriptive
91   message payloads for flexible interaction with network-based hypertext
92   information systems. This document is the first in a series of documents
93   that collectively form the HTTP/1.1 specification:
94   <list style="empty">
95    <t>RFC xxx1: Message Syntax and Routing</t>
96    <t>RFC xxx2: Semantics and Content</t>
97    <t>RFC xxx3: Conditional Requests</t>
98    <t>RFC xxx4: Range Requests</t>
99    <t>RFC xxx5: Caching</t>
100    <t>RFC xxx6: Authentication</t>
101   </list>
102</t>
103<t>
104   This HTTP/1.1 specification obsoletes and moves to historic status
105   RFC 2616, its predecessor
106   RFC 2068, and
107   RFC 2145 (on HTTP versioning).
108   This specification also updates the use of CONNECT to establish a tunnel,
109   previously defined in RFC 2817,
110   and defines the "https" URI scheme that was described informally in
111   RFC 2818.
112</t>
113<t>
114   HTTP is a generic interface protocol for information systems. It is
115   designed to hide the details of how a service is implemented by presenting
116   a uniform interface to clients that is independent of the types of
117   resources provided. Likewise, servers do not need to be aware of each
118   client's purpose: an HTTP request can be considered in isolation rather
119   than being associated with a specific type of client or a predetermined
120   sequence of application steps. The result is a protocol that can be used
121   effectively in many different contexts and for which implementations can
122   evolve independently over time.
123</t>
124<t>
125   HTTP is also designed for use as an intermediation protocol for translating
126   communication to and from non-HTTP information systems.
127   HTTP proxies and gateways can provide access to alternative information
128   services by translating their diverse protocols into a hypertext
129   format that can be viewed and manipulated by clients in the same way
130   as HTTP services.
131</t>
132<t>
133   One consequence of this flexibility is that the protocol cannot be
134   defined in terms of what occurs behind the interface. Instead, we
135   are limited to defining the syntax of communication, the intent
136   of received communication, and the expected behavior of recipients.
137   If the communication is considered in isolation, then successful
138   actions ought to be reflected in corresponding changes to the
139   observable interface provided by servers. However, since multiple
140   clients might act in parallel and perhaps at cross-purposes, we
141   cannot require that such changes be observable beyond the scope
142   of a single response.
143</t>
144<t>
145   This document describes the architectural elements that are used or
146   referred to in HTTP, defines the "http" and "https" URI schemes,
147   describes overall network operation and connection management,
148   and defines HTTP message framing and forwarding requirements.
149   Our goal is to define all of the mechanisms necessary for HTTP message
150   handling that are independent of message semantics, thereby defining the
151   complete set of requirements for message parsers and
152   message-forwarding intermediaries.
153</t>
154
155
156<section title="Requirement Notation" anchor="intro.requirements">
157<t>
158   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
159   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
160   document are to be interpreted as described in <xref target="RFC2119"/>.
161</t>
162<t>
163   Conformance criteria and considerations regarding error handling
164   are defined in <xref target="conformance"/>.
165</t>
166</section>
167
168<section title="Syntax Notation" anchor="notation">
169<iref primary="true" item="Grammar" subitem="ALPHA"/>
170<iref primary="true" item="Grammar" subitem="CR"/>
171<iref primary="true" item="Grammar" subitem="CRLF"/>
172<iref primary="true" item="Grammar" subitem="CTL"/>
173<iref primary="true" item="Grammar" subitem="DIGIT"/>
174<iref primary="true" item="Grammar" subitem="DQUOTE"/>
175<iref primary="true" item="Grammar" subitem="HEXDIG"/>
176<iref primary="true" item="Grammar" subitem="HTAB"/>
177<iref primary="true" item="Grammar" subitem="LF"/>
178<iref primary="true" item="Grammar" subitem="OCTET"/>
179<iref primary="true" item="Grammar" subitem="SP"/>
180<iref primary="true" item="Grammar" subitem="VCHAR"/>
181<t>
182   This specification uses the Augmented Backus-Naur Form (ABNF) notation
183   of <xref target="RFC5234"/> with the list rule extension defined in
184   <xref target="abnf.extension"/>.  <xref target="collected.abnf"/> shows
185   the collected ABNF with the list rule expanded.
186</t>
187<t anchor="core.rules">
188 
189 
190 
191 
192 
193 
194 
195 
196 
197 
198 
199 
200   The following core rules are included by
201   reference, as defined in <xref target="RFC5234"/>, Appendix B.1:
202   ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
203   DIGIT (decimal 0-9), DQUOTE (double quote),
204   HEXDIG (hexadecimal 0-9/A-F/a-f), HTAB (horizontal tab), LF (line feed),
205   OCTET (any 8-bit sequence of data), SP (space), and
206   VCHAR (any visible <xref target="USASCII"/> character).
207</t>
208<t>
209   As a convention, ABNF rule names prefixed with "obs-" denote
210   "obsolete" grammar rules that appear for historical reasons.
211</t>
212</section>
213</section>
214
215<section title="Architecture" anchor="architecture">
216<t>
217   HTTP was created for the World Wide Web architecture
218   and has evolved over time to support the scalability needs of a worldwide
219   hypertext system. Much of that architecture is reflected in the terminology
220   and syntax productions used to define HTTP.
221</t>
222
223<section title="Client/Server Messaging" anchor="operation">
224<iref primary="true" item="client"/>
225<iref primary="true" item="server"/>
226<iref primary="true" item="connection"/>
227<t>
228   HTTP is a stateless request/response protocol that operates by exchanging
229   messages (<xref target="http.message"/>) across a reliable
230   transport or session-layer
231   "connection" (<xref target="connection.management"/>).
232   An HTTP "client" is a program that establishes a connection
233   to a server for the purpose of sending one or more HTTP requests.
234   An HTTP "server" is a program that accepts connections
235   in order to service HTTP requests by sending HTTP responses.
236</t>
237<iref primary="true" item="user agent"/>
238<iref primary="true" item="origin server"/>
239<iref primary="true" item="browser"/>
240<iref primary="true" item="spider"/>
241<iref primary="true" item="sender"/>
242<iref primary="true" item="recipient"/>
243<t>
244   The terms client and server refer only to the roles that
245   these programs perform for a particular connection.  The same program
246   might act as a client on some connections and a server on others.
247   We use the term "user agent" to refer to any of the various
248   client programs that initiate a request, including (but not limited to)
249   browsers, spiders (web-based robots), command-line tools, native
250   applications, and mobile apps.  The term "origin server" is
251   used to refer to the program that can originate authoritative responses to
252   a request. For general requirements, we use the terms
253   "sender" and "recipient" to refer to any
254   component that sends or receives, respectively, a given message.
255</t>
256<t>
257   HTTP relies upon the Uniform Resource Identifier (URI)
258   standard <xref target="RFC3986"/> to indicate the target resource
259   (<xref target="target-resource"/>) and relationships between resources.
260   Messages are passed in a format similar to that used by Internet mail
261   <xref target="RFC5322"/> and the Multipurpose Internet Mail Extensions
262   (MIME) <xref target="RFC2045"/> (see Appendix A of <xref target="Part2"/> for the differences
263   between HTTP and MIME messages).
264</t>
265<t>
266   Most HTTP communication consists of a retrieval request (GET) for
267   a representation of some resource identified by a URI.  In the
268   simplest case, this might be accomplished via a single bidirectional
269   connection (===) between the user agent (UA) and the origin server (O).
270</t>
271<figure><artwork type="drawing"><![CDATA[
272         request   >
273    UA ======================================= O
274                                <   response
275]]></artwork></figure>
276<iref primary="true" item="message"/>
277<iref primary="true" item="request"/>
278<iref primary="true" item="response"/>
279<t>
280   A client sends an HTTP request to a server in the form of a request
281   message, beginning with a request-line that includes a method, URI, and
282   protocol version (<xref target="request.line"/>),
283   followed by header fields containing
284   request modifiers, client information, and representation metadata
285   (<xref target="header.fields"/>),
286   an empty line to indicate the end of the header section, and finally
287   a message body containing the payload body (if any,
288   <xref target="message.body"/>).
289</t>
290<t>
291   A server responds to a client's request by sending one or more HTTP
292   response
293   messages, each beginning with a status line that
294   includes the protocol version, a success or error code, and textual
295   reason phrase (<xref target="status.line"/>),
296   possibly followed by header fields containing server
297   information, resource metadata, and representation metadata
298   (<xref target="header.fields"/>),
299   an empty line to indicate the end of the header section, and finally
300   a message body containing the payload body (if any,
301   <xref target="message.body"/>).
302</t>
303<t>
304   A connection might be used for multiple request/response exchanges,
305   as defined in <xref target="persistent.connections"/>.
306</t>
307<t>
308   The following example illustrates a typical message exchange for a
309   GET request on the URI "http://www.example.com/hello.txt":
310</t>
311<figure><preamble>
312client request:
313</preamble><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
314  GET /hello.txt HTTP/1.1
315  User-Agent: curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
316  Host: www.example.com
317  Accept-Language: en, mi
318 
319  ]]></artwork></figure>
320<figure><preamble>
321server response:
322</preamble><artwork type="message/http; msgtype=&#34;response&#34;"><![CDATA[
323  HTTP/1.1 200 OK
324  Date: Mon, 27 Jul 2009 12:28:53 GMT
325  Server: Apache
326  Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
327  ETag: "34aa387-d-1568eb00"
328  Accept-Ranges: bytes
329  Content-Length: 14
330  Vary: Accept-Encoding
331  Content-Type: text/plain
332 
333  Hello World!
334  ]]></artwork>
335<postamble>
336(Note that the content length includes the trailing CR/LF sequence of the body text)
337</postamble></figure>
338</section>
339
340<section title="Implementation Diversity" anchor="implementation-diversity">
341<t>
342   When considering the design of HTTP, it is easy to fall into a trap of
343   thinking that all user agents are general-purpose browsers and all origin
344   servers are large public websites. That is not the case in practice.
345   Common HTTP user agents include household appliances, stereos, scales,
346   firmware update scripts, command-line programs, mobile apps,
347   and communication devices in a multitude of shapes and sizes.  Likewise,
348   common HTTP origin servers include home automation units, configurable
349   networking components, office machines, autonomous robots, news feeds,
350   traffic cameras, ad selectors, and video delivery platforms.
351</t>
352<t>
353   The term "user agent" does not imply that there is a human user directly
354   interacting with the software agent at the time of a request. In many
355   cases, a user agent is installed or configured to run in the background
356   and save its results for later inspection (or save only a subset of those
357   results that might be interesting or erroneous). Spiders, for example, are
358   typically given a start URI and configured to follow certain behavior while
359   crawling the Web as a hypertext graph.
360</t>
361<t>
362   The implementation diversity of HTTP means that we cannot assume the
363   user agent can make interactive suggestions to a user or provide adequate
364   warning for security or privacy options.  In the few cases where this
365   specification requires reporting of errors to the user, it is acceptable
366   for such reporting to only be observable in an error console or log file.
367   Likewise, requirements that an automated action be confirmed by the user
368   before proceeding can be met via advance configuration choices,
369   run-time options, or simply not proceeding with the unsafe action.
370</t>
371</section>
372
373<section title="Intermediaries" anchor="intermediaries">
374<iref primary="true" item="intermediary"/>
375<t>
376   HTTP enables the use of intermediaries to satisfy requests through
377   a chain of connections.  There are three common forms of HTTP
378   intermediary: proxy, gateway, and tunnel.  In some cases,
379   a single intermediary might act as an origin server, proxy, gateway,
380   or tunnel, switching behavior based on the nature of each request.
381</t>
382<figure><artwork type="drawing"><![CDATA[
383         >             >             >             >
384    UA =========== A =========== B =========== C =========== O
385               <             <             <             <
386]]></artwork></figure>
387<t>
388   The figure above shows three intermediaries (A, B, and C) between the
389   user agent and origin server. A request or response message that
390   travels the whole chain will pass through four separate connections.
391   Some HTTP communication options
392   might apply only to the connection with the nearest, non-tunnel
393   neighbor, only to the end-points of the chain, or to all connections
394   along the chain. Although the diagram is linear, each participant might
395   be engaged in multiple, simultaneous communications. For example, B
396   might be receiving requests from many clients other than A, and/or
397   forwarding requests to servers other than C, at the same time that it
398   is handling A's request.
399</t>
400<t>
401<iref primary="true" item="upstream"/><iref primary="true" item="downstream"/>
402<iref primary="true" item="inbound"/><iref primary="true" item="outbound"/>
403   We use the terms "upstream" and "downstream"
404   to describe various requirements in relation to the directional flow of a
405   message: all messages flow from upstream to downstream.
406   Likewise, we use the terms inbound and outbound to refer to
407   directions in relation to the request path:
408   "inbound" means toward the origin server and
409   "outbound" means toward the user agent.
410</t>
411<t><iref primary="true" item="proxy"/>
412   A "proxy" is a message forwarding agent that is selected by the
413   client, usually via local configuration rules, to receive requests
414   for some type(s) of absolute URI and attempt to satisfy those
415   requests via translation through the HTTP interface.  Some translations
416   are minimal, such as for proxy requests for "http" URIs, whereas
417   other requests might require translation to and from entirely different
418   application-level protocols. Proxies are often used to group an
419   organization's HTTP requests through a common intermediary for the
420   sake of security, annotation services, or shared caching.
421</t>
422<t>
423<iref primary="true" item="transforming proxy"/>
424<iref primary="true" item="non-transforming proxy"/>
425   An HTTP-to-HTTP proxy is called a "transforming proxy" if it is designed
426   or configured to modify request or response messages in a semantically
427   meaningful way (i.e., modifications, beyond those required by normal
428   HTTP processing, that change the message in a way that would be
429   significant to the original sender or potentially significant to
430   downstream recipients).  For example, a transforming proxy might be
431   acting as a shared annotation server (modifying responses to include
432   references to a local annotation database), a malware filter, a
433   format transcoder, or an intranet-to-Internet privacy filter.  Such
434   transformations are presumed to be desired by the client (or client
435   organization) that selected the proxy and are beyond the scope of
436   this specification.  However, when a proxy is not intended to transform
437   a given message, we use the term "non-transforming proxy" to target
438   requirements that preserve HTTP message semantics. See Section 6.3.4 of <xref target="Part2"/> and
439   Section 7.5 of <xref target="Part6"/> for status and warning codes related to transformations.
440</t>
441<t><iref primary="true" item="gateway"/><iref primary="true" item="reverse proxy"/>
442<iref primary="true" item="accelerator"/>
443   A "gateway" (a.k.a., "reverse proxy")
444   is a receiving agent that acts
445   as a layer above some other server(s) and translates the received
446   requests to the underlying server's protocol.  Gateways are often
447   used to encapsulate legacy or untrusted information services, to
448   improve server performance through "accelerator" caching, and to
449   enable partitioning or load-balancing of HTTP services across
450   multiple machines.
451</t>
452<t>
453   A gateway behaves as an origin server on its outbound connection and
454   as a user agent on its inbound connection.
455   All HTTP requirements applicable to an origin server
456   also apply to the outbound communication of a gateway.
457   A gateway communicates with inbound servers using any protocol that
458   it desires, including private extensions to HTTP that are outside
459   the scope of this specification.  However, an HTTP-to-HTTP gateway
460   that wishes to interoperate with third-party HTTP servers MUST
461   conform to HTTP user agent requirements on the gateway's inbound
462   connection and MUST implement the <xref target="header.connection" format="none">Connection</xref>
463   (<xref target="header.connection"/>) and <xref target="header.via" format="none">Via</xref>
464   (<xref target="header.via"/>) header fields for both connections.
465</t>
466<t><iref primary="true" item="tunnel"/>
467   A "tunnel" acts as a blind relay between two connections
468   without changing the messages. Once active, a tunnel is not
469   considered a party to the HTTP communication, though the tunnel might
470   have been initiated by an HTTP request. A tunnel ceases to exist when
471   both ends of the relayed connection are closed. Tunnels are used to
472   extend a virtual connection through an intermediary, such as when
473   Transport Layer Security (TLS, <xref target="RFC5246"/>) is used to
474   establish confidential communication through a shared firewall proxy.
475</t>
476<t><iref primary="true" item="interception proxy"/>
477<iref primary="true" item="transparent proxy"/>
478<iref primary="true" item="captive portal"/>
479   The above categories for intermediary only consider those acting as
480   participants in the HTTP communication.  There are also intermediaries
481   that can act on lower layers of the network protocol stack, filtering or
482   redirecting HTTP traffic without the knowledge or permission of message
483   senders. Network intermediaries often introduce security flaws or
484   interoperability problems by violating HTTP semantics.  For example, an
485   "interception proxy" <xref target="RFC3040"/> (also commonly
486   known as a "transparent proxy" <xref target="RFC1919"/> or
487   "captive portal")
488   differs from an HTTP proxy because it is not selected by the client.
489   Instead, an interception proxy filters or redirects outgoing TCP port 80
490   packets (and occasionally other common port traffic).
491   Interception proxies are commonly found on public network access points,
492   as a means of enforcing account subscription prior to allowing use of
493   non-local Internet services, and within corporate firewalls to enforce
494   network usage policies.
495   They are indistinguishable from a man-in-the-middle attack.
496</t>
497<t>
498   HTTP is defined as a stateless protocol, meaning that each request message
499   can be understood in isolation.  Many implementations depend on HTTP's
500   stateless design in order to reuse proxied connections or dynamically
501   load-balance requests across multiple servers.  Hence, servers MUST NOT
502   assume that two requests on the same connection are from the same user
503   agent unless the connection is secured and specific to that agent.
504   Some non-standard HTTP extensions (e.g., <xref target="RFC4559"/>) have
505   been known to violate this requirement, resulting in security and
506   interoperability problems.
507</t>
508</section>
509
510<section title="Caches" anchor="caches">
511<iref primary="true" item="cache"/>
512<t>
513   A "cache" is a local store of previous response messages and the
514   subsystem that controls its message storage, retrieval, and deletion.
515   A cache stores cacheable responses in order to reduce the response
516   time and network bandwidth consumption on future, equivalent
517   requests. Any client or server MAY employ a cache, though a cache
518   cannot be used by a server while it is acting as a tunnel.
519</t>
520<t>
521   The effect of a cache is that the request/response chain is shortened
522   if one of the participants along the chain has a cached response
523   applicable to that request. The following illustrates the resulting
524   chain if B has a cached copy of an earlier response from O (via C)
525   for a request that has not been cached by UA or A.
526</t>
527<figure><artwork type="drawing"><![CDATA[
528            >             >
529       UA =========== A =========== B - - - - - - C - - - - - - O
530                  <             <
531]]></artwork></figure>
532<t><iref primary="true" item="cacheable"/>
533   A response is "cacheable" if a cache is allowed to store a copy of
534   the response message for use in answering subsequent requests.
535   Even when a response is cacheable, there might be additional
536   constraints placed by the client or by the origin server on when
537   that cached response can be used for a particular request. HTTP
538   requirements for cache behavior and cacheable responses are
539   defined in Section 2 of <xref target="Part6"/>. 
540</t>
541<t>
542   There are a wide variety of architectures and configurations
543   of caches deployed across the World Wide Web and
544   inside large organizations. These include national hierarchies
545   of proxy caches to save transoceanic bandwidth, collaborative systems that
546   broadcast or multicast cache entries, archives of pre-fetched cache
547   entries for use in off-line or high-latency environments, and so on.
548</t>
549</section>
550
551<section title="Conformance and Error Handling" anchor="conformance">
552<t>
553   This specification targets conformance criteria according to the role of
554   a participant in HTTP communication.  Hence, HTTP requirements are placed
555   on senders, recipients, clients, servers, user agents, intermediaries,
556   origin servers, proxies, gateways, or caches, depending on what behavior
557   is being constrained by the requirement. Additional (social) requirements
558   are placed on implementations, resource owners, and protocol element
559   registrations when they apply beyond the scope of a single communication.
560</t>
561<t>
562   The verb "generate" is used instead of "send" where a requirement
563   differentiates between creating a protocol element and merely forwarding a
564   received element downstream.
565</t>
566<t>
567   An implementation is considered conformant if it complies with all of the
568   requirements associated with the roles it partakes in HTTP. Note that
569   SHOULD-level requirements are relevant here, unless one of the documented
570   exceptions is applicable.
571</t>
572<t>
573   Conformance applies to both the syntax and semantics of HTTP protocol
574   elements. A sender MUST NOT generate protocol elements that convey a
575   meaning that is known by that sender to be false. A sender MUST NOT
576   generate protocol elements that do not match the grammar defined by the
577   ABNF rules for those protocol elements that are applicable to the sender's
578   role. If a received protocol element is processed, the recipient MUST be
579   able to parse any value that would match the ABNF rules for that protocol
580   element, excluding only those rules not applicable to the recipient's role.
581</t>
582<t>
583   Unless noted otherwise, a recipient MAY attempt to recover a usable
584   protocol element from an invalid construct.  HTTP does not define
585   specific error handling mechanisms except when they have a direct impact
586   on security, since different applications of the protocol require
587   different error handling strategies.  For example, a Web browser might
588   wish to transparently recover from a response where the
589   Location header field doesn't parse according to the ABNF,
590   whereas a systems control client might consider any form of error recovery
591   to be dangerous.
592</t>
593</section>
594
595<section title="Protocol Versioning" anchor="http.version">
596 
597 
598<t>
599   HTTP uses a "&lt;major&gt;.&lt;minor&gt;" numbering scheme to indicate
600   versions of the protocol. This specification defines version "1.1".
601   The protocol version as a whole indicates the sender's conformance
602   with the set of requirements laid out in that version's corresponding
603   specification of HTTP.
604</t>
605<t>
606   The version of an HTTP message is indicated by an HTTP-version field
607   in the first line of the message. HTTP-version is case-sensitive.
608</t>
609<figure><iref primary="true" item="Grammar" subitem="HTTP-version"/><iref primary="true" item="Grammar" subitem="HTTP-name"/><artwork type="abnf2616"><![CDATA[
610  HTTP-version  = HTTP-name "/" DIGIT "." DIGIT
611  HTTP-name     = %x48.54.54.50 ; "HTTP", case-sensitive
612]]></artwork></figure>
613<t>
614   The HTTP version number consists of two decimal digits separated by a "."
615   (period or decimal point).  The first digit ("major version") indicates the
616   HTTP messaging syntax, whereas the second digit ("minor version") indicates
617   the highest minor version to which the sender is
618   conformant and able to understand for future communication.  The minor
619   version advertises the sender's communication capabilities even when the
620   sender is only using a backwards-compatible subset of the protocol,
621   thereby letting the recipient know that more advanced features can
622   be used in response (by servers) or in future requests (by clients).
623</t>
624<t>
625   When an HTTP/1.1 message is sent to an HTTP/1.0 recipient
626   <xref target="RFC1945"/> or a recipient whose version is unknown,
627   the HTTP/1.1 message is constructed such that it can be interpreted
628   as a valid HTTP/1.0 message if all of the newer features are ignored.
629   This specification places recipient-version requirements on some
630   new features so that a conformant sender will only use compatible
631   features until it has determined, through configuration or the
632   receipt of a message, that the recipient supports HTTP/1.1.
633</t>
634<t>
635   The interpretation of a header field does not change between minor
636   versions of the same major HTTP version, though the default
637   behavior of a recipient in the absence of such a field can change.
638   Unless specified otherwise, header fields defined in HTTP/1.1 are
639   defined for all versions of HTTP/1.x.  In particular, the <xref target="header.host" format="none">Host</xref>
640   and <xref target="header.connection" format="none">Connection</xref> header fields ought to be implemented by all
641   HTTP/1.x implementations whether or not they advertise conformance with
642   HTTP/1.1.
643</t>
644<t>
645   New header fields can be defined such that, when they are
646   understood by a recipient, they might override or enhance the
647   interpretation of previously defined header fields.  When an
648   implementation receives an unrecognized header field, the recipient
649   MUST ignore that header field for local processing regardless of
650   the message's HTTP version.  An unrecognized header field received
651   by a proxy MUST be forwarded downstream unless the header field's
652   field-name is listed in the message's <xref target="header.connection" format="none">Connection</xref> header field
653   (see <xref target="header.connection"/>).
654   These requirements allow HTTP's functionality to be enhanced without
655   requiring prior update of deployed intermediaries.
656</t>
657<t>
658   Intermediaries that process HTTP messages (i.e., all intermediaries
659   other than those acting as tunnels) MUST send their own HTTP-version
660   in forwarded messages.  In other words, they MUST NOT blindly
661   forward the first line of an HTTP message without ensuring that the
662   protocol version in that message matches a version to which that
663   intermediary is conformant for both the receiving and
664   sending of messages.  Forwarding an HTTP message without rewriting
665   the HTTP-version might result in communication errors when downstream
666   recipients use the message sender's version to determine what features
667   are safe to use for later communication with that sender.
668</t>
669<t>
670   An HTTP client SHOULD send a request version equal to the highest
671   version to which the client is conformant and
672   whose major version is no higher than the highest version supported
673   by the server, if this is known.  An HTTP client MUST NOT send a
674   version to which it is not conformant.
675</t>
676<t>
677   An HTTP client MAY send a lower request version if it is known that
678   the server incorrectly implements the HTTP specification, but only
679   after the client has attempted at least one normal request and determined
680   from the response status or header fields (e.g., Server) that
681   the server improperly handles higher request versions.
682</t>
683<t>
684   An HTTP server SHOULD send a response version equal to the highest
685   version to which the server is conformant and
686   whose major version is less than or equal to the one received in the
687   request.  An HTTP server MUST NOT send a version to which it is not
688   conformant.  A server MAY send a 505 (HTTP Version Not
689   Supported) response if it cannot send a response using the
690   major version used in the client's request.
691</t>
692<t>
693   An HTTP server MAY send an HTTP/1.0 response to an HTTP/1.0 request
694   if it is known or suspected that the client incorrectly implements the
695   HTTP specification and is incapable of correctly processing later
696   version responses, such as when a client fails to parse the version
697   number correctly or when an intermediary is known to blindly forward
698   the HTTP-version even when it doesn't conform to the given minor
699   version of the protocol. Such protocol downgrades SHOULD NOT be
700   performed unless triggered by specific client attributes, such as when
701   one or more of the request header fields (e.g., User-Agent)
702   uniquely match the values sent by a client known to be in error.
703</t>
704<t>
705   The intention of HTTP's versioning design is that the major number
706   will only be incremented if an incompatible message syntax is
707   introduced, and that the minor number will only be incremented when
708   changes made to the protocol have the effect of adding to the message
709   semantics or implying additional capabilities of the sender.  However,
710   the minor version was not incremented for the changes introduced between
711   <xref target="RFC2068"/> and <xref target="RFC2616"/>, and this revision
712   has specifically avoiding any such changes to the protocol.
713</t>
714</section>
715
716<section title="Uniform Resource Identifiers" anchor="uri">
717<iref primary="true" item="resource"/>
718<t>
719   Uniform Resource Identifiers (URIs) <xref target="RFC3986"/> are used
720   throughout HTTP as the means for identifying resources (Section 2 of <xref target="Part2"/>).
721   URI references are used to target requests, indicate redirects, and define
722   relationships.
723</t>
724 
725 
726 
727 
728 
729 
730 
731 
732 
733 
734 
735<t>
736   This specification adopts the definitions of "URI-reference",
737   "absolute-URI", "relative-part", "port", "host",
738   "path-abempty", "query", "segment", and "authority" from the
739   URI generic syntax.
740   In addition, we define an "absolute-path" rule (that differs from
741   RFC 3986's "path-absolute" in that it allows a leading "//")
742   and a "partial-URI" rule for protocol elements
743   that allow a relative URI but not a fragment.
744</t>
745<figure><iref primary="true" item="Grammar" subitem="URI-reference"><!--exported production--></iref><iref primary="true" item="Grammar" subitem="absolute-URI"/><iref primary="true" item="Grammar" subitem="authority"/><iref primary="true" item="Grammar" subitem="absolute-path"/><iref primary="true" item="Grammar" subitem="port"/><iref primary="true" item="Grammar" subitem="query"/><iref primary="true" item="Grammar" subitem="segment"/><iref primary="true" item="Grammar" subitem="uri-host"/><iref primary="true" item="Grammar" subitem="partial-URI"><!--exported production--></iref><artwork type="abnf2616"><![CDATA[
746  URI-reference = <URI-reference, defined in [RFC3986], Section 4.1>
747  absolute-URI  = <absolute-URI, defined in [RFC3986], Section 4.3>
748  relative-part = <relative-part, defined in [RFC3986], Section 4.2>
749  authority     = <authority, defined in [RFC3986], Section 3.2>
750  path-abempty  = <path-abempty, defined in [RFC3986], Section 3.3>
751  port          = <port, defined in [RFC3986], Section 3.2.3>
752  query         = <query, defined in [RFC3986], Section 3.4>
753  segment       = <segment, defined in [RFC3986], Section 3.3>
754  uri-host      = <host, defined in [RFC3986], Section 3.2.2>
755 
756  absolute-path = 1*( "/" segment )
757  partial-URI   = relative-part [ "?" query ]
758]]></artwork></figure>
759<t>
760   Each protocol element in HTTP that allows a URI reference will indicate
761   in its ABNF production whether the element allows any form of reference
762   (URI-reference), only a URI in absolute form (absolute-URI), only the
763   path and optional query components, or some combination of the above.
764   Unless otherwise indicated, URI references are parsed
765   relative to the effective request URI
766   (<xref target="effective.request.uri"/>).
767</t>
768
769<section title="http URI scheme" anchor="http.uri">
770 
771  <iref item="http URI scheme" primary="true"/>
772  <iref item="URI scheme" subitem="http" primary="true"/>
773<t>
774   The "http" URI scheme is hereby defined for the purpose of minting
775   identifiers according to their association with the hierarchical
776   namespace governed by a potential HTTP origin server listening for
777   TCP connections on a given port.
778</t>
779<figure><iref primary="true" item="Grammar" subitem="http-URI"><!--terminal production--></iref><artwork type="abnf2616"><![CDATA[
780  http-URI = "http:" "//" authority path-abempty [ "?" query ]
781]]></artwork></figure>
782<t>
783   The HTTP origin server is identified by the generic syntax's
784   <xref target="uri" format="none">authority</xref> component, which includes a host identifier
785   and optional TCP port (<xref target="RFC3986"/>, Section 3.2.2).
786   The remainder of the URI, consisting of both the hierarchical path
787   component and optional query component, serves as an identifier for
788   a potential resource within that origin server's name space.
789</t>
790<t>
791   If the host identifier is provided as an IP address,
792   then the origin server is any listener on the indicated TCP port at
793   that IP address. If host is a registered name, then that name is
794   considered an indirect identifier and the recipient might use a name
795   resolution service, such as DNS, to find the address of a listener
796   for that host.
797   The host MUST NOT be empty; if an "http" URI is received with an
798   empty host, then it MUST be rejected as invalid.
799   If the port subcomponent is empty or not given, then TCP port 80 is
800   assumed (the default reserved port for WWW services).
801</t>
802<t>
803   Regardless of the form of host identifier, access to that host is not
804   implied by the mere presence of its name or address. The host might or might
805   not exist and, even when it does exist, might or might not be running an
806   HTTP server or listening to the indicated port. The "http" URI scheme
807   makes use of the delegated nature of Internet names and addresses to
808   establish a naming authority (whatever entity has the ability to place
809   an HTTP server at that Internet name or address) and allows that
810   authority to determine which names are valid and how they might be used.
811</t>
812<t>
813   When an "http" URI is used within a context that calls for access to the
814   indicated resource, a client MAY attempt access by resolving
815   the host to an IP address, establishing a TCP connection to that address
816   on the indicated port, and sending an HTTP request message
817   (<xref target="http.message"/>) containing the URI's identifying data
818   (<xref target="message.routing"/>) to the server.
819   If the server responds to that request with a non-interim HTTP response
820   message, as described in Section 6 of <xref target="Part2"/>, then that response
821   is considered an authoritative answer to the client's request.
822</t>
823<t>
824   Although HTTP is independent of the transport protocol, the "http"
825   scheme is specific to TCP-based services because the name delegation
826   process depends on TCP for establishing authority.
827   An HTTP service based on some other underlying connection protocol
828   would presumably be identified using a different URI scheme, just as
829   the "https" scheme (below) is used for resources that require an
830   end-to-end secured connection. Other protocols might also be used to
831   provide access to "http" identified resources — it is only the
832   authoritative interface used for mapping the namespace that is
833   specific to TCP.
834</t>
835<t>
836   The URI generic syntax for authority also includes a deprecated
837   userinfo subcomponent (<xref target="RFC3986"/>, Section 3.2.1)
838   for including user authentication information in the URI.  Some
839   implementations make use of the userinfo component for internal
840   configuration of authentication information, such as within command
841   invocation options, configuration files, or bookmark lists, even
842   though such usage might expose a user identifier or password.
843   Senders MUST exclude the userinfo subcomponent (and its "@"
844   delimiter) when an "http" URI is transmitted within a message as a
845   request target or header field value.
846   Recipients of an "http" URI reference SHOULD parse for userinfo and
847   treat its presence as an error, since it is likely being used to obscure
848   the authority for the sake of phishing attacks.
849</t>
850</section>
851
852<section title="https URI scheme" anchor="https.uri">
853   
854   <iref item="https URI scheme"/>
855   <iref item="URI scheme" subitem="https"/>
856<t>
857   The "https" URI scheme is hereby defined for the purpose of minting
858   identifiers according to their association with the hierarchical
859   namespace governed by a potential HTTP origin server listening to a
860   given TCP port for TLS-secured connections <xref target="RFC5246"/>.
861</t>
862<t>
863   All of the requirements listed above for the "http" scheme are also
864   requirements for the "https" scheme, except that a default TCP port
865   of 443 is assumed if the port subcomponent is empty or not given,
866   and the TCP connection MUST be secured, end-to-end, through the
867   use of strong encryption prior to sending the first HTTP request.
868</t>
869<figure><iref primary="true" item="Grammar" subitem="https-URI"><!--terminal production--></iref><artwork type="abnf2616"><![CDATA[
870  https-URI = "https:" "//" authority path-abempty [ "?" query ]
871]]></artwork></figure>
872<t>
873   Resources made available via the "https" scheme have no shared
874   identity with the "http" scheme even if their resource identifiers
875   indicate the same authority (the same host listening to the same
876   TCP port).  They are distinct name spaces and are considered to be
877   distinct origin servers.  However, an extension to HTTP that is
878   defined to apply to entire host domains, such as the Cookie protocol
879   <xref target="RFC6265"/>, can allow information
880   set by one service to impact communication with other services
881   within a matching group of host domains.
882</t>
883<t>
884   The process for authoritative access to an "https" identified
885   resource is defined in <xref target="RFC2818"/>.
886</t>
887</section>
888
889<section title="http and https URI Normalization and Comparison" anchor="uri.comparison">
890<t>
891   Since the "http" and "https" schemes conform to the URI generic syntax,
892   such URIs are normalized and compared according to the algorithm defined
893   in <xref target="RFC3986"/>, Section 6, using the defaults
894   described above for each scheme.
895</t>
896<t>
897   If the port is equal to the default port for a scheme, the normal form is
898   to elide the port subcomponent. When not being used in absolute form as the
899   request target of an OPTIONS request, an empty path component is equivalent
900   to an absolute path of "/", so the normal form is to provide a path of "/"
901   instead. The scheme and host are case-insensitive and normally provided in
902   lowercase; all other components are compared in a case-sensitive manner.
903   Characters other than those in the "reserved" set are equivalent to their
904   percent-encoded octets (see <xref target="RFC3986"/>, Section 2.1): the normal form is to not encode them.
905</t>
906<t>
907   For example, the following three URIs are equivalent:
908</t>
909<figure><artwork type="example"><![CDATA[
910   http://example.com:80/~smith/home.html
911   http://EXAMPLE.com/%7Esmith/home.html
912   http://EXAMPLE.com:/%7esmith/home.html
913]]></artwork></figure>
914</section>
915</section>
916</section>
917
918<section title="Message Format" anchor="http.message">
919
920
921
922
923<iref item="header section"/>
924<iref item="headers"/>
925<iref item="header field"/>
926<t>
927   All HTTP/1.1 messages consist of a start-line followed by a sequence of
928   octets in a format similar to the Internet Message Format
929   <xref target="RFC5322"/>: zero or more header fields (collectively
930   referred to as the "headers" or the "header section"), an empty line
931   indicating the end of the header section, and an optional message body.
932</t>
933<figure><iref primary="true" item="Grammar" subitem="HTTP-message"><!--terminal production--></iref><artwork type="abnf2616"><![CDATA[
934  HTTP-message   = start-line
935                   *( header-field CRLF )
936                   CRLF
937                   [ message-body ]
938]]></artwork></figure>
939<t>
940   The normal procedure for parsing an HTTP message is to read the
941   start-line into a structure, read each header field into a hash
942   table by field name until the empty line, and then use the parsed
943   data to determine if a message body is expected.  If a message body
944   has been indicated, then it is read as a stream until an amount
945   of octets equal to the message body length is read or the connection
946   is closed.
947</t>
948<t>
949   Recipients MUST parse an HTTP message as a sequence of octets in an
950   encoding that is a superset of US-ASCII <xref target="USASCII"/>.
951   Parsing an HTTP message as a stream of Unicode characters, without regard
952   for the specific encoding, creates security vulnerabilities due to the
953   varying ways that string processing libraries handle invalid multibyte
954   character sequences that contain the octet LF (%x0A).  String-based
955   parsers can only be safely used within protocol elements after the element
956   has been extracted from the message, such as within a header field-value
957   after message parsing has delineated the individual fields.
958</t>
959<t>
960   An HTTP message can be parsed as a stream for incremental processing or
961   forwarding downstream.  However, recipients cannot rely on incremental
962   delivery of partial messages, since some implementations will buffer or
963   delay message forwarding for the sake of network efficiency, security
964   checks, or payload transformations.
965</t>
966
967<section title="Start Line" anchor="start.line">
968 
969<t>
970   An HTTP message can either be a request from client to server or a
971   response from server to client.  Syntactically, the two types of message
972   differ only in the start-line, which is either a request-line (for requests)
973   or a status-line (for responses), and in the algorithm for determining
974   the length of the message body (<xref target="message.body"/>).
975</t>
976<t>
977   In theory, a client could receive requests and a server could receive
978   responses, distinguishing them by their different start-line formats,
979   but in practice servers are implemented to only expect a request
980   (a response is interpreted as an unknown or invalid request method)
981   and clients are implemented to only expect a response.
982</t>
983<figure><iref primary="true" item="Grammar" subitem="start-line"/><artwork type="abnf2616"><![CDATA[
984  start-line     = request-line / status-line
985]]></artwork></figure>
986<t>
987   A sender MUST NOT send whitespace between the start-line and
988   the first header field. The presence of such whitespace in a request
989   might be an attempt to trick a server into ignoring that field or
990   processing the line after it as a new request, either of which might
991   result in a security vulnerability if other implementations within
992   the request chain interpret the same message differently.
993   Likewise, the presence of such whitespace in a response might be
994   ignored by some clients or cause others to cease parsing.
995</t>
996<t>
997   A recipient that receives whitespace between the start-line and
998   the first header field MUST either reject the message as invalid or
999   consume each whitespace-preceded line without further processing of it
1000   (i.e., ignore the entire line, along with any subsequent lines preceded
1001   by whitespace, until a properly formed header field is received or the
1002   header block is terminated).
1003</t>
1004
1005<section title="Request Line" anchor="request.line">
1006 
1007 
1008<t>
1009   A request-line begins with a method token, followed by a single
1010   space (SP), the request-target, another single space (SP), the
1011   protocol version, and ending with CRLF.
1012</t>
1013<figure><iref primary="true" item="Grammar" subitem="request-line"/><artwork type="abnf2616"><![CDATA[
1014  request-line   = method SP request-target SP HTTP-version CRLF
1015]]></artwork></figure>
1016<iref primary="true" item="method"/>
1017<t anchor="method">
1018   The method token indicates the request method to be performed on the
1019   target resource. The request method is case-sensitive.
1020</t>
1021<figure><iref primary="true" item="Grammar" subitem="method"/><artwork type="abnf2616"><![CDATA[
1022  method         = token
1023]]></artwork></figure>
1024<t>
1025   The methods defined by this specification can be found in
1026   Section 4 of <xref target="Part2"/>, along with information regarding the HTTP method registry
1027   and considerations for defining new methods.
1028</t>
1029<iref item="request-target"/>
1030<t>
1031   The request-target identifies the target resource upon which to apply
1032   the request, as defined in <xref target="request-target"/>.
1033</t>
1034<t>
1035   No whitespace is allowed inside the method, request-target, and
1036   protocol version.  Hence, recipients typically parse the request-line
1037   into its component parts by splitting on whitespace
1038   (see <xref target="message.robustness"/>).
1039</t>
1040<t>
1041   Unfortunately, some user agents fail to properly encode hypertext
1042   references that have embedded whitespace, sending the characters directly
1043   instead of properly encoding or excluding the disallowed characters.
1044   Recipients of an invalid request-line SHOULD respond with either a
1045   400 (Bad Request) error or a 301 (Moved Permanently)
1046   redirect with the request-target properly encoded.  Recipients SHOULD NOT
1047   attempt to autocorrect and then process the request without a redirect,
1048   since the invalid request-line might be deliberately crafted to bypass
1049   security filters along the request chain.
1050</t>
1051<t>
1052   HTTP does not place a pre-defined limit on the length of a request-line.
1053   A server that receives a method longer than any that it implements
1054   SHOULD respond with a 501 (Not Implemented) status code.
1055   A server MUST be prepared to receive URIs of unbounded length and
1056   respond with the 414 (URI Too Long) status code if the received
1057   request-target would be longer than the server wishes to handle
1058   (see Section 6.5.12 of <xref target="Part2"/>).
1059</t>
1060<t>
1061   Various ad-hoc limitations on request-line length are found in practice.
1062   It is RECOMMENDED that all HTTP senders and recipients support, at a
1063   minimum, request-line lengths of 8000 octets.
1064</t>
1065</section>
1066
1067<section title="Status Line" anchor="status.line">
1068 
1069 
1070 
1071 
1072<t>
1073   The first line of a response message is the status-line, consisting
1074   of the protocol version, a space (SP), the status code, another space,
1075   a possibly-empty textual phrase describing the status code, and
1076   ending with CRLF.
1077</t>
1078<figure><iref primary="true" item="Grammar" subitem="status-line"/><artwork type="abnf2616"><![CDATA[
1079  status-line = HTTP-version SP status-code SP reason-phrase CRLF
1080]]></artwork></figure>
1081<t>
1082   The status-code element is a 3-digit integer code describing the
1083   result of the server's attempt to understand and satisfy the client's
1084   corresponding request. The rest of the response message is to be
1085   interpreted in light of the semantics defined for that status code.
1086   See Section 6 of <xref target="Part2"/> for information about the semantics of status codes,
1087   including the classes of status code (indicated by the first digit),
1088   the status codes defined by this specification, considerations for the
1089   definition of new status codes, and the IANA registry.
1090</t>
1091<figure><iref primary="true" item="Grammar" subitem="status-code"/><artwork type="abnf2616"><![CDATA[
1092  status-code    = 3DIGIT
1093]]></artwork></figure>
1094<t>  
1095   The reason-phrase element exists for the sole purpose of providing a
1096   textual description associated with the numeric status code, mostly
1097   out of deference to earlier Internet application protocols that were more
1098   frequently used with interactive text clients. A client SHOULD ignore
1099   the reason-phrase content.
1100</t>
1101<figure><iref primary="true" item="Grammar" subitem="reason-phrase"/><artwork type="abnf2616"><![CDATA[
1102  reason-phrase  = *( HTAB / SP / VCHAR / obs-text )
1103]]></artwork></figure>
1104</section>
1105</section>
1106
1107<section title="Header Fields" anchor="header.fields">
1108 
1109 
1110 
1111 
1112 
1113<t>
1114   Each HTTP header field consists of a case-insensitive field name
1115   followed by a colon (":"), optional whitespace, and the field value.
1116</t>
1117<figure><iref primary="true" item="Grammar" subitem="header-field"/><iref primary="true" item="Grammar" subitem="field-name"/><iref primary="true" item="Grammar" subitem="field-value"/><iref primary="true" item="Grammar" subitem="field-content"/><iref primary="true" item="Grammar" subitem="obs-fold"/><artwork type="abnf2616"><![CDATA[
1118  header-field   = field-name ":" OWS field-value BWS
1119  field-name     = token
1120  field-value    = *( field-content / obs-fold )
1121  field-content  = *( HTAB / SP / VCHAR / obs-text )
1122  obs-fold       = CRLF ( SP / HTAB )
1123                 ; obsolete line folding
1124                 ; see Section 3.2.4
1125]]></artwork></figure>
1126<t>
1127   The field-name token labels the corresponding field-value as having the
1128   semantics defined by that header field.  For example, the Date
1129   header field is defined in Section 7.1.1.2 of <xref target="Part2"/> as containing the origination
1130   timestamp for the message in which it appears.
1131</t>
1132
1133<section title="Field Extensibility" anchor="field.extensibility">
1134<t>
1135   HTTP header fields are fully extensible: there is no limit on the
1136   introduction of new field names, each presumably defining new semantics,
1137   nor on the number of header fields used in a given message.  Existing
1138   fields are defined in each part of this specification and in many other
1139   specifications outside the core standard.
1140   New header fields can be introduced without changing the protocol version
1141   if their defined semantics allow them to be safely ignored by recipients
1142   that do not recognize them.
1143</t>
1144<t>
1145   New HTTP header fields ought to be be registered with IANA in the
1146   Message Header Field Registry, as described in Section 8.3 of <xref target="Part2"/>.
1147   A proxy MUST forward unrecognized header fields unless the
1148   field-name is listed in the <xref target="header.connection" format="none">Connection</xref> header field
1149   (<xref target="header.connection"/>) or the proxy is specifically
1150   configured to block, or otherwise transform, such fields.
1151   Other recipients SHOULD ignore unrecognized header fields.
1152</t>
1153</section>
1154
1155<section title="Field Order" anchor="field.order">
1156<t>
1157   The order in which header fields with differing field names are
1158   received is not significant. However, it is "good practice" to send
1159   header fields that contain control data first, such as <xref target="header.host" format="none">Host</xref>
1160   on requests and Date on responses, so that implementations
1161   can decide when not to handle a message as early as possible.  A server
1162   MUST wait until the entire header section is received before interpreting
1163   a request message, since later header fields might include conditionals,
1164   authentication credentials, or deliberately misleading duplicate
1165   header fields that would impact request processing.
1166</t>
1167<t>
1168   A sender MUST NOT generate multiple header fields with the same field
1169   name in a message unless either the entire field value for that
1170   header field is defined as a comma-separated list [i.e., #(values)]
1171   or the header field is a well-known exception (as noted below).
1172</t>
1173<t>
1174   Multiple header fields with the same field name can be combined into
1175   one "field-name: field-value" pair, without changing the semantics of the
1176   message, by appending each subsequent field value to the combined
1177   field value in order, separated by a comma. The order in which
1178   header fields with the same field name are received is therefore
1179   significant to the interpretation of the combined field value;
1180   a proxy MUST NOT change the order of these field values when
1181   forwarding a message.
1182</t>
1183<t><list>
1184  <t>
1185   Note: In practice, the "Set-Cookie" header field (<xref target="RFC6265"/>)
1186   often appears multiple times in a response message and does not use the
1187   list syntax, violating the above requirements on multiple header fields
1188   with the same name. Since it cannot be combined into a single field-value,
1189   recipients ought to handle "Set-Cookie" as a special case while processing
1190   header fields. (See Appendix A.2.3 of <xref target="Kri2001"/> for details.)
1191  </t>
1192</list></t>
1193</section>
1194
1195<section title="Whitespace" anchor="whitespace">
1196<t anchor="rule.LWS">
1197   This specification uses three rules to denote the use of linear
1198   whitespace: OWS (optional whitespace), RWS (required whitespace), and
1199   BWS ("bad" whitespace).
1200</t>
1201<t anchor="rule.OWS">
1202   The OWS rule is used where zero or more linear whitespace octets might
1203   appear. OWS SHOULD either not be generated or be generated as a single
1204   SP. Multiple OWS octets that occur within field-content SHOULD either
1205   be replaced with a single SP or transformed to all SP octets (each
1206   octet other than SP replaced with SP) before interpreting the field value
1207   or forwarding the message downstream.
1208</t>
1209<t anchor="rule.RWS">
1210   RWS is used when at least one linear whitespace octet is required to
1211   separate field tokens. RWS SHOULD be generated as a single SP.
1212   Multiple RWS octets that occur within field-content SHOULD either
1213   be replaced with a single SP or transformed to all SP octets before
1214   interpreting the field value or forwarding the message downstream.
1215</t>
1216<t anchor="rule.BWS">
1217   BWS is used where the grammar allows optional whitespace, for historical
1218   reasons, but senders SHOULD NOT generate it in messages;
1219   recipients MUST accept such bad optional whitespace and remove it before
1220   interpreting the field value or forwarding the message downstream.
1221</t>
1222<t anchor="rule.whitespace">
1223 
1224 
1225 
1226</t>
1227<figure><iref primary="true" item="Grammar" subitem="OWS"/><iref primary="true" item="Grammar" subitem="RWS"/><iref primary="true" item="Grammar" subitem="BWS"/><artwork type="abnf2616"><![CDATA[
1228  OWS            = *( SP / HTAB )
1229                 ; optional whitespace
1230  RWS            = 1*( SP / HTAB )
1231                 ; required whitespace
1232  BWS            = OWS
1233                 ; "bad" whitespace
1234]]></artwork></figure>
1235</section>
1236
1237<section title="Field Parsing" anchor="field.parsing">
1238<t>
1239   No whitespace is allowed between the header field-name and colon.
1240   In the past, differences in the handling of such whitespace have led to
1241   security vulnerabilities in request routing and response handling.
1242   A server MUST reject any received request message that contains
1243   whitespace between a header field-name and colon with a response code of
1244   400 (Bad Request). A proxy MUST remove any such whitespace
1245   from a response message before forwarding the message downstream.
1246</t>
1247<t>
1248   A field value is preceded by optional whitespace (OWS); a single SP is
1249   preferred. The field value does not include any leading or trailing white
1250   space: OWS occurring before the first non-whitespace octet of the
1251   field value or after the last non-whitespace octet of the field value
1252   is ignored and SHOULD be removed before further processing (as this does
1253   not change the meaning of the header field).
1254</t>
1255<t>
1256   Historically, HTTP header field values could be extended over multiple
1257   lines by preceding each extra line with at least one space or horizontal
1258   tab (obs-fold). This specification deprecates such line folding except
1259   within the message/http media type
1260   (<xref target="internet.media.type.message.http"/>).
1261   Senders MUST NOT generate messages that include line folding
1262   (i.e., that contain any field-value that contains a match to the
1263   <xref target="header.fields" format="none">obs-fold</xref> rule) unless the message is intended for packaging
1264   within the message/http media type. When an <xref target="header.fields" format="none">obs-fold</xref> is
1265   received in a message, recipients MUST do one of:
1266   <list style="symbols">
1267      <t>accept the message and replace any embedded <xref target="header.fields" format="none">obs-fold</xref>
1268         whitespace with either a single <xref target="core.rules" format="none">SP</xref> or a matching
1269         number of <xref target="core.rules" format="none">SP</xref> octets (to avoid buffer copying) prior to
1270         interpreting the field value or forwarding the message
1271         downstream;</t>
1272
1273      <t>if it is a request, reject the message by sending a
1274         400 (Bad Request) response with a representation
1275         explaining that obsolete line folding is unacceptable; or,</t>
1276         
1277      <t>if it is a response, discard the message and generate a
1278         502 (Bad Gateway) response with a representation
1279         explaining that unacceptable line folding was received.</t>
1280   </list>
1281   Recipients that choose not to implement <xref target="header.fields" format="none">obs-fold</xref> processing
1282   (as described above) MUST NOT accept messages containing header fields
1283   with leading whitespace, as this can expose them to attacks that exploit
1284   this difference in processing.
1285</t>
1286<t>
1287   Historically, HTTP has allowed field content with text in the ISO-8859-1
1288   <xref target="ISO-8859-1"/> charset, supporting other charsets only
1289   through use of <xref target="RFC2047"/> encoding.
1290   In practice, most HTTP header field values use only a subset of the
1291   US-ASCII charset <xref target="USASCII"/>. Newly defined
1292   header fields SHOULD limit their field values to US-ASCII octets.
1293   Recipients SHOULD treat other octets in field content (obs-text) as
1294   opaque data.
1295</t>
1296</section>
1297
1298<section title="Field Limits" anchor="field.limits">
1299<t>
1300   HTTP does not place a pre-defined limit on the length of each header field
1301   or on the length of the header block as a whole.  Various ad-hoc
1302   limitations on individual header field length are found in practice,
1303   often depending on the specific field semantics.
1304</t>
1305<t>
1306   A server MUST be prepared to receive request header fields of unbounded
1307   length and respond with an appropriate 4xx (Client Error)
1308   status code if the received header field(s) are larger than the server
1309   wishes to process.
1310</t>
1311<t>
1312   A client MUST be prepared to receive response header fields of unbounded
1313   length. A client MAY discard or truncate received header fields that are
1314   larger than the client wishes to process if the field semantics are such
1315   that the dropped value(s) can be safely ignored without changing the
1316   response semantics.
1317</t>
1318</section>
1319
1320<section title="Field value components" anchor="field.components">
1321<t anchor="rule.token.separators">
1322 
1323 
1324 
1325 
1326   Many HTTP header field values consist of words (token or quoted-string)
1327   separated by whitespace or special characters. These special characters
1328   MUST be in a quoted string to be used within a parameter value (as defined
1329   in <xref target="transfer.codings"/>).
1330</t>
1331<figure><iref primary="true" item="Grammar" subitem="word"/><iref primary="true" item="Grammar" subitem="token"/><iref primary="true" item="Grammar" subitem="tchar"/><iref primary="true" item="Grammar" subitem="special"><!--unused production--></iref><artwork type="abnf2616"><![CDATA[
1332  word           = token / quoted-string
1333
1334  token          = 1*tchar
1335
1336  tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
1337                 / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
1338                 / DIGIT / ALPHA
1339                 ; any VCHAR, except special
1340
1341  special        = "(" / ")" / "<" / ">" / "@" / ","
1342                 / ";" / ":" / "\" / DQUOTE / "/" / "["
1343                 / "]" / "?" / "=" / "{" / "}"
1344]]></artwork></figure>
1345<t anchor="rule.quoted-string">
1346 
1347 
1348 
1349   A string of text is parsed as a single word if it is quoted using
1350   double-quote marks.
1351</t>
1352<figure><iref primary="true" item="Grammar" subitem="quoted-string"/><iref primary="true" item="Grammar" subitem="qdtext"/><iref primary="true" item="Grammar" subitem="obs-text"/><artwork type="abnf2616"><![CDATA[
1353  quoted-string  = DQUOTE *( qdtext / quoted-pair ) DQUOTE
1354  qdtext         = HTAB / SP /%x21 / %x23-5B / %x5D-7E / obs-text
1355  obs-text       = %x80-FF
1356]]></artwork></figure>
1357<t anchor="rule.quoted-pair">
1358 
1359   The backslash octet ("\") can be used as a single-octet
1360   quoting mechanism within quoted-string constructs:
1361</t>
1362<figure><iref primary="true" item="Grammar" subitem="quoted-pair"/><artwork type="abnf2616"><![CDATA[
1363  quoted-pair    = "\" ( HTAB / SP / VCHAR / obs-text )
1364]]></artwork></figure>
1365<t>
1366   Recipients that process the value of a quoted-string MUST handle a
1367   quoted-pair as if it were replaced by the octet following the backslash.
1368</t>
1369<t>
1370   Senders SHOULD NOT generate a quoted-pair in a quoted-string except where
1371   necessary to quote DQUOTE and backslash octets occurring within that string.
1372</t>
1373<t anchor="rule.comment">
1374 
1375 
1376   Comments can be included in some HTTP header fields by surrounding
1377   the comment text with parentheses. Comments are only allowed in
1378   fields containing "comment" as part of their field value definition.
1379</t>
1380<figure><iref primary="true" item="Grammar" subitem="comment"/><iref primary="true" item="Grammar" subitem="ctext"/><artwork type="abnf2616"><![CDATA[
1381  comment        = "(" *( ctext / quoted-cpair / comment ) ")"
1382  ctext          = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text
1383]]></artwork></figure>
1384<t anchor="rule.quoted-cpair">
1385 
1386   The backslash octet ("\") can be used as a single-octet
1387   quoting mechanism within comment constructs:
1388</t>
1389<figure><iref primary="true" item="Grammar" subitem="quoted-cpair"/><artwork type="abnf2616"><![CDATA[
1390  quoted-cpair   = "\" ( HTAB / SP / VCHAR / obs-text )
1391]]></artwork></figure>
1392<t>
1393   Senders SHOULD NOT escape octets in comments that do not require escaping
1394   (i.e., other than the backslash octet "\" and the parentheses "(" and ")").
1395</t>
1396</section>
1397
1398</section>
1399
1400<section title="Message Body" anchor="message.body">
1401 
1402<t>
1403   The message body (if any) of an HTTP message is used to carry the
1404   payload body of that request or response.  The message body is
1405   identical to the payload body unless a transfer coding has been
1406   applied, as described in <xref target="header.transfer-encoding"/>.
1407</t>
1408<figure><iref primary="true" item="Grammar" subitem="message-body"/><artwork type="abnf2616"><![CDATA[
1409  message-body = *OCTET
1410]]></artwork></figure>
1411<t>
1412   The rules for when a message body is allowed in a message differ for
1413   requests and responses.
1414</t>
1415<t>
1416   The presence of a message body in a request is signaled by a
1417   <xref target="header.content-length" format="none">Content-Length</xref> or <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header
1418   field. Request message framing is independent of method semantics,
1419   even if the method does not define any use for a message body.
1420</t>
1421<t>
1422   The presence of a message body in a response depends on both
1423   the request method to which it is responding and the response
1424   status code (<xref target="status.line"/>).
1425   Responses to the HEAD request method never include a message body
1426   because the associated response header fields (e.g.,
1427   <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref>, <xref target="header.content-length" format="none">Content-Length</xref>, etc.),
1428   if present, indicate only what their values would have been if the request
1429   method had been GET (Section 4.3.2 of <xref target="Part2"/>).
1430   2xx (Successful) responses to CONNECT switch to tunnel
1431   mode instead of having a message body (Section 4.3.6 of <xref target="Part2"/>).
1432   All 1xx (Informational), 204 (No Content), and
1433   304 (Not Modified) responses do not include a message body.
1434   All other responses do include a message body, although the body
1435   might be of zero length.
1436</t>
1437
1438<section title="Transfer-Encoding" anchor="header.transfer-encoding">
1439  <iref primary="true" item="Transfer-Encoding header field"/>
1440  <iref item="chunked (Coding Format)"/>
1441 
1442<t>
1443   The Transfer-Encoding header field lists the transfer coding names
1444   corresponding to the sequence of transfer codings that have been
1445   (or will be) applied to the payload body in order to form the message body.
1446   Transfer codings are defined in <xref target="transfer.codings"/>.
1447</t>
1448<figure><iref primary="true" item="Grammar" subitem="Transfer-Encoding"/><artwork type="abnf2616"><![CDATA[
1449  Transfer-Encoding = 1#transfer-coding
1450]]></artwork></figure>
1451<t>
1452   Transfer-Encoding is analogous to the Content-Transfer-Encoding field of
1453   MIME, which was designed to enable safe transport of binary data over a
1454   7-bit transport service (<xref target="RFC2045"/>, Section 6).
1455   However, safe transport has a different focus for an 8bit-clean transfer
1456   protocol. In HTTP's case, Transfer-Encoding is primarily intended to
1457   accurately delimit a dynamically generated payload and to distinguish
1458   payload encodings that are only applied for transport efficiency or
1459   security from those that are characteristics of the selected resource.
1460</t>
1461<t>
1462   All HTTP/1.1 recipients MUST implement the chunked transfer coding
1463   (<xref target="chunked.encoding"/>) because it plays a crucial role in
1464   framing messages when the payload body size is not known in advance.
1465   If chunked is applied to a payload body, the sender MUST NOT apply
1466   chunked more than once (i.e., chunking an already chunked message is not
1467   allowed).
1468   If any transfer coding is applied to a request payload body, the
1469   sender MUST apply chunked as the final transfer coding to ensure that
1470   the message is properly framed.
1471   If any transfer coding is applied to a response payload body, the
1472   sender MUST either apply chunked as the final transfer coding or
1473   terminate the message by closing the connection.
1474</t>
1475<figure><preamble>
1476   For example,
1477</preamble><artwork type="example"><![CDATA[
1478  Transfer-Encoding: gzip, chunked
1479]]></artwork><postamble>
1480   indicates that the payload body has been compressed using the gzip
1481   coding and then chunked using the chunked coding while forming the
1482   message body.
1483</postamble></figure>
1484<t>
1485   Unlike Content-Encoding (Section 3.1.2.1 of <xref target="Part2"/>),
1486   Transfer-Encoding is a property of the message, not of the representation, and
1487   any recipient along the request/response chain MAY decode the received
1488   transfer coding(s) or apply additional transfer coding(s) to the message
1489   body, assuming that corresponding changes are made to the Transfer-Encoding
1490   field-value. Additional information about the encoding parameters MAY be
1491   provided by other header fields not defined by this specification.
1492</t>
1493<t>
1494   Transfer-Encoding MAY be sent in a response to a HEAD request or in a
1495   304 (Not Modified) response (Section 4.1 of <xref target="Part4"/>) to a GET request,
1496   neither of which includes a message body,
1497   to indicate that the origin server would have applied a transfer coding
1498   to the message body if the request had been an unconditional GET.
1499   This indication is not required, however, because any recipient on
1500   the response chain (including the origin server) can remove transfer
1501   codings when they are not needed.
1502</t>
1503<t>
1504   Transfer-Encoding was added in HTTP/1.1.  It is generally assumed that
1505   implementations advertising only HTTP/1.0 support will not understand
1506   how to process a transfer-encoded payload.
1507   A client MUST NOT send a request containing Transfer-Encoding unless it
1508   knows the server will handle HTTP/1.1 (or later) requests; such knowledge
1509   might be in the form of specific user configuration or by remembering the
1510   version of a prior received response.
1511   A server MUST NOT send a response containing Transfer-Encoding unless
1512   the corresponding request indicates HTTP/1.1 (or later).
1513</t>
1514<t>
1515   A server that receives a request message with a transfer coding it does
1516   not understand SHOULD respond with 501 (Not Implemented).
1517</t>
1518</section>
1519
1520<section title="Content-Length" anchor="header.content-length">
1521  <iref primary="true" item="Content-Length header field"/>
1522 
1523<t>
1524   When a message does not have a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header
1525   field, a Content-Length header field can provide the anticipated size,
1526   as a decimal number of octets, for a potential payload body.
1527   For messages that do include a payload body, the Content-Length field-value
1528   provides the framing information necessary for determining where the body
1529   (and message) ends.  For messages that do not include a payload body, the
1530   Content-Length indicates the size of the selected representation
1531   (Section 3 of <xref target="Part2"/>).
1532</t>
1533<figure><iref primary="true" item="Grammar" subitem="Content-Length"/><artwork type="abnf2616"><![CDATA[
1534  Content-Length = 1*DIGIT
1535]]></artwork></figure>
1536<t>
1537   An example is
1538</t>
1539<figure><artwork type="example"><![CDATA[
1540  Content-Length: 3495
1541]]></artwork></figure>
1542<t>
1543   A sender MUST NOT send a Content-Length header field in any message that
1544   contains a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field.
1545</t>
1546<t>
1547   A user agent SHOULD send a Content-Length in a request message when no
1548   <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> is sent and the request method defines
1549   a meaning for an enclosed payload body. For example, a Content-Length
1550   header field is normally sent in a POST request even when the value is
1551   0 (indicating an empty payload body).  A user agent SHOULD NOT send a
1552   Content-Length header field when the request message does not contain a
1553   payload body and the method semantics do not anticipate such a body.
1554</t>
1555<t>
1556   A server MAY send a Content-Length header field in a response to a HEAD
1557   request (Section 4.3.2 of <xref target="Part2"/>); a server MUST NOT send Content-Length in such a
1558   response unless its field-value equals the decimal number of octets that
1559   would have been sent in the payload body of a response if the same
1560   request had used the GET method.
1561</t>
1562<t>
1563   A server MAY send a Content-Length header field in a
1564   304 (Not Modified) response to a conditional GET request
1565   (Section 4.1 of <xref target="Part4"/>); a server MUST NOT send Content-Length in such a
1566   response unless its field-value equals the decimal number of octets that
1567   would have been sent in the payload body of a 200 (OK)
1568   response to the same request.
1569</t>
1570<t>
1571   A server MUST NOT send a Content-Length header field in any response
1572   with a status code of
1573   1xx (Informational) or 204 (No Content).
1574   A server SHOULD NOT send a Content-Length header field in any
1575   2xx (Successful) response to a CONNECT request (Section 4.3.6 of <xref target="Part2"/>).
1576</t>
1577<t>
1578   Aside from the cases defined above, in the absence of Transfer-Encoding,
1579   an origin server SHOULD send a Content-Length header field when the
1580   payload body size is known prior to sending the complete header block.
1581   This will allow downstream recipients to measure transfer progress,
1582   know when a received message is complete, and potentially reuse the
1583   connection for additional requests.
1584</t>
1585<t>
1586   Any Content-Length field value greater than or equal to zero is valid.
1587   Since there is no predefined limit to the length of a payload,
1588   recipients SHOULD anticipate potentially large decimal numerals and
1589   prevent parsing errors due to integer conversion overflows
1590   (<xref target="attack.protocol.element.size.overflows"/>).
1591</t>
1592<t>
1593   If a message is received that has multiple Content-Length header fields
1594   with field-values consisting of the same decimal value, or a single
1595   Content-Length header field with a field value containing a list of
1596   identical decimal values (e.g., "Content-Length: 42, 42"), indicating that
1597   duplicate Content-Length header fields have been generated or combined by an
1598   upstream message processor, then the recipient MUST either reject the
1599   message as invalid or replace the duplicated field-values with a single
1600   valid Content-Length field containing that decimal value prior to
1601   determining the message body length.
1602</t>
1603<t><list>
1604  <t>
1605   Note: HTTP's use of Content-Length for message framing differs
1606   significantly from the same field's use in MIME, where it is an optional
1607   field used only within the "message/external-body" media-type.
1608  </t>
1609</list></t>
1610</section>
1611
1612<section title="Message Body Length" anchor="message.body.length">
1613  <iref item="chunked (Coding Format)"/>
1614<t>
1615   The length of a message body is determined by one of the following
1616   (in order of precedence):
1617</t>
1618<t>
1619  <list style="numbers">
1620    <t>
1621     Any response to a HEAD request and any response with a
1622     1xx (Informational), 204 (No Content), or
1623     304 (Not Modified) status code is always
1624     terminated by the first empty line after the header fields, regardless of
1625     the header fields present in the message, and thus cannot contain a
1626     message body.
1627    </t>
1628    <t>
1629     Any 2xx (Successful) response to a CONNECT request implies that the
1630     connection will become a tunnel immediately after the empty line that
1631     concludes the header fields.  A client MUST ignore any
1632     <xref target="header.content-length" format="none">Content-Length</xref> or <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header
1633     fields received in such a message.
1634    </t>
1635    <t>
1636     If a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field is present
1637     and the chunked transfer coding (<xref target="chunked.encoding"/>)
1638     is the final encoding, the message body length is determined by reading
1639     and decoding the chunked data until the transfer coding indicates the
1640     data is complete.
1641    <vspace blankLines="1"/>
1642     If a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field is present in a
1643     response and the chunked transfer coding is not the final encoding, the
1644     message body length is determined by reading the connection until it is
1645     closed by the server.
1646     If a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field is present in a request and the
1647     chunked transfer coding is not the final encoding, the message body
1648     length cannot be determined reliably; the server MUST respond with
1649     the 400 (Bad Request) status code and then close the connection.
1650    <vspace blankLines="1"/>
1651     If a message is received with both a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref>
1652     and a <xref target="header.content-length" format="none">Content-Length</xref> header field, the Transfer-Encoding
1653     overrides the Content-Length. Such a message might indicate an attempt
1654     to perform request or response smuggling (bypass of security-related
1655     checks on message routing or content) and thus ought to be handled as
1656     an error.  A sender MUST remove the received Content-Length field
1657     prior to forwarding such a message downstream.
1658    </t>
1659    <t>
1660     If a message is received without <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> and with
1661     either multiple <xref target="header.content-length" format="none">Content-Length</xref> header fields having
1662     differing field-values or a single Content-Length header field having an
1663     invalid value, then the message framing is invalid and MUST be treated
1664     as an error to prevent request or response smuggling.
1665     If this is a request message, the server MUST respond with
1666     a 400 (Bad Request) status code and then close the connection.
1667     If this is a response message received by a proxy, the proxy
1668     MUST discard the received response, send a 502 (Bad Gateway)
1669     status code as its downstream response, and then close the connection.
1670     If this is a response message received by a user agent, it MUST be
1671     treated as an error by discarding the message and closing the connection.
1672    </t>
1673    <t>
1674     If a valid <xref target="header.content-length" format="none">Content-Length</xref> header field is present without
1675     <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref>, its decimal value defines the
1676     expected message body length in octets.
1677     If the sender closes the connection or the recipient times out before the
1678     indicated number of octets are received, the recipient MUST consider
1679     the message to be incomplete and close the connection.
1680    </t>
1681    <t>
1682     If this is a request message and none of the above are true, then the
1683     message body length is zero (no message body is present).
1684    </t>
1685    <t>
1686     Otherwise, this is a response message without a declared message body
1687     length, so the message body length is determined by the number of octets
1688     received prior to the server closing the connection.
1689    </t>
1690  </list>
1691</t>
1692<t>
1693   Since there is no way to distinguish a successfully completed,
1694   close-delimited message from a partially-received message interrupted
1695   by network failure, a server SHOULD use encoding or
1696   length-delimited messages whenever possible.  The close-delimiting
1697   feature exists primarily for backwards compatibility with HTTP/1.0.
1698</t>
1699<t>
1700   A server MAY reject a request that contains a message body but
1701   not a <xref target="header.content-length" format="none">Content-Length</xref> by responding with
1702   411 (Length Required).
1703</t>
1704<t>
1705   Unless a transfer coding other than chunked has been applied,
1706   a client that sends a request containing a message body SHOULD
1707   use a valid <xref target="header.content-length" format="none">Content-Length</xref> header field if the message body
1708   length is known in advance, rather than the chunked transfer coding, since some
1709   existing services respond to chunked with a 411 (Length Required)
1710   status code even though they understand the chunked transfer coding.  This
1711   is typically because such services are implemented via a gateway that
1712   requires a content-length in advance of being called and the server
1713   is unable or unwilling to buffer the entire request before processing.
1714</t>
1715<t>
1716   A user agent that sends a request containing a message body MUST send a
1717   valid <xref target="header.content-length" format="none">Content-Length</xref> header field if it does not know the
1718   server will handle HTTP/1.1 (or later) requests; such knowledge can be in
1719   the form of specific user configuration or by remembering the version of a
1720   prior received response.
1721</t>
1722<t>
1723   If the final response to the last request on a connection has been
1724   completely received and there remains additional data to read, a user agent
1725   MAY discard the remaining data or attempt to determine if that data
1726   belongs as part of the prior response body, which might be the case if the
1727   prior message's Content-Length value is incorrect. A client MUST NOT
1728   process, cache, or forward such extra data as a separate response, since
1729   such behavior would be vulnerable to cache poisoning.
1730</t>
1731</section>
1732</section>
1733
1734<section anchor="incomplete.messages" title="Handling Incomplete Messages">
1735<t>
1736   A server that receives an incomplete request message, usually due to a
1737   canceled request or a triggered time-out exception, MAY send an error
1738   response prior to closing the connection.
1739</t>
1740<t>
1741   A client that receives an incomplete response message, which can occur
1742   when a connection is closed prematurely or when decoding a supposedly
1743   chunked transfer coding fails, MUST record the message as incomplete.
1744   Cache requirements for incomplete responses are defined in
1745   Section 3 of <xref target="Part6"/>.
1746</t>
1747<t>
1748   If a response terminates in the middle of the header block (before the
1749   empty line is received) and the status code might rely on header fields to
1750   convey the full meaning of the response, then the client cannot assume
1751   that meaning has been conveyed; the client might need to repeat the
1752   request in order to determine what action to take next.
1753</t>
1754<t>
1755   A message body that uses the chunked transfer coding is
1756   incomplete if the zero-sized chunk that terminates the encoding has not
1757   been received.  A message that uses a valid <xref target="header.content-length" format="none">Content-Length</xref> is
1758   incomplete if the size of the message body received (in octets) is less than
1759   the value given by Content-Length.  A response that has neither chunked
1760   transfer coding nor Content-Length is terminated by closure of the
1761   connection, and thus is considered complete regardless of the number of
1762   message body octets received, provided that the header block was received
1763   intact.
1764</t>
1765</section>
1766
1767<section title="Message Parsing Robustness" anchor="message.robustness">
1768<t>
1769   Older HTTP/1.0 user agent implementations might send an extra CRLF
1770   after a POST request as a lame workaround for some early server
1771   applications that failed to read message body content that was
1772   not terminated by a line-ending. An HTTP/1.1 user agent MUST NOT
1773   preface or follow a request with an extra CRLF.  If terminating
1774   the request message body with a line-ending is desired, then the
1775   user agent MUST count the terminating CRLF octets as part of the
1776   message body length.
1777</t>
1778<t>
1779   In the interest of robustness, servers SHOULD ignore at least one
1780   empty line received where a request-line is expected. In other words, if
1781   a server is reading the protocol stream at the beginning of a
1782   message and receives a CRLF first, the server SHOULD ignore the CRLF.
1783</t>
1784<t>
1785   Although the line terminator for the start-line and header
1786   fields is the sequence CRLF, recipients MAY recognize a
1787   single LF as a line terminator and ignore any preceding CR.
1788</t>
1789<t>
1790   Although the request-line and status-line grammar rules require that each
1791   of the component elements be separated by a single SP octet, recipients
1792   MAY instead parse on whitespace-delimited word boundaries and, aside
1793   from the CRLF terminator, treat any form of whitespace as the SP separator
1794   while ignoring preceding or trailing whitespace;
1795   such whitespace includes one or more of the following octets:
1796   SP, HTAB, VT (%x0B), FF (%x0C), or bare CR.
1797</t>
1798<t>
1799   When a server listening only for HTTP request messages, or processing
1800   what appears from the start-line to be an HTTP request message,
1801   receives a sequence of octets that does not match the HTTP-message
1802   grammar aside from the robustness exceptions listed above, the
1803   server SHOULD respond with a 400 (Bad Request) response. 
1804</t>
1805</section>
1806</section>
1807
1808<section title="Transfer Codings" anchor="transfer.codings">
1809 
1810 
1811<t>
1812   Transfer coding names are used to indicate an encoding
1813   transformation that has been, can be, or might need to be applied to a
1814   payload body in order to ensure "safe transport" through the network.
1815   This differs from a content coding in that the transfer coding is a
1816   property of the message rather than a property of the representation
1817   that is being transferred.
1818</t>
1819<figure><iref primary="true" item="Grammar" subitem="transfer-coding"/><iref primary="true" item="Grammar" subitem="transfer-extension"/><artwork type="abnf2616"><![CDATA[
1820  transfer-coding    = "chunked" ; Section 4.1
1821                     / "compress" ; Section 4.2.1
1822                     / "deflate" ; Section 4.2.2
1823                     / "gzip" ; Section 4.2.3
1824                     / transfer-extension
1825  transfer-extension = token *( OWS ";" OWS transfer-parameter )
1826]]></artwork></figure>
1827<t anchor="rule.parameter">
1828 
1829 
1830 
1831   Parameters are in the form of attribute/value pairs.
1832</t>
1833<figure><iref primary="true" item="Grammar" subitem="transfer-parameter"/><iref primary="true" item="Grammar" subitem="attribute"/><iref primary="true" item="Grammar" subitem="value"/><iref primary="true" item="Grammar" subitem="date2"/><iref primary="true" item="Grammar" subitem="date3"/><artwork type="abnf2616"><![CDATA[
1834  transfer-parameter = attribute BWS "=" BWS value
1835  attribute          = token
1836  value              = word
1837]]></artwork></figure>
1838<t>
1839   All transfer-coding names are case-insensitive and ought to be registered
1840   within the HTTP Transfer Coding registry, as defined in
1841   <xref target="transfer.coding.registry"/>.
1842   They are used in the <xref target="header.te" format="none">TE</xref> (<xref target="header.te"/>) and
1843   <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> (<xref target="header.transfer-encoding"/>)
1844   header fields.
1845</t>
1846
1847<section title="Chunked Transfer Coding" anchor="chunked.encoding">
1848  <iref primary="true" item="chunked (Coding Format)"/>
1849 
1850 
1851 
1852 
1853 
1854 
1855 
1856 
1857 
1858 
1859 
1860<t>
1861   The chunked transfer coding modifies the body of a message in order to
1862   transfer it as a series of chunks, each with its own size indicator,
1863   followed by an OPTIONAL trailer containing header fields. This
1864   allows dynamically generated content to be transferred along with the
1865   information necessary for the recipient to verify that it has
1866   received the full message.
1867</t>
1868<figure><iref primary="true" item="Grammar" subitem="chunked-body"><!--terminal production--></iref><iref primary="true" item="Grammar" subitem="chunk"/><iref primary="true" item="Grammar" subitem="chunk-size"/><iref primary="true" item="Grammar" subitem="last-chunk"/><iref primary="true" item="Grammar" subitem="chunk-ext"/><iref primary="true" item="Grammar" subitem="chunk-ext-name"/><iref primary="true" item="Grammar" subitem="chunk-ext-val"/><iref primary="true" item="Grammar" subitem="chunk-data"/><iref primary="true" item="Grammar" subitem="trailer-part"/><iref primary="true" item="Grammar" subitem="quoted-str-nf"/><iref primary="true" item="Grammar" subitem="qdtext-nf"/><artwork type="abnf2616"><![CDATA[
1869  chunked-body   = *chunk
1870                   last-chunk
1871                   trailer-part
1872                   CRLF
1873 
1874  chunk          = chunk-size [ chunk-ext ] CRLF
1875                   chunk-data CRLF
1876  chunk-size     = 1*HEXDIG
1877  last-chunk     = 1*("0") [ chunk-ext ] CRLF
1878 
1879  chunk-ext      = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
1880  chunk-ext-name = token
1881  chunk-ext-val  = token / quoted-str-nf
1882  chunk-data     = 1*OCTET ; a sequence of chunk-size octets
1883  trailer-part   = *( header-field CRLF )
1884 
1885  quoted-str-nf  = DQUOTE *( qdtext-nf / quoted-pair ) DQUOTE
1886                 ; like quoted-string, but disallowing line folding
1887  qdtext-nf      = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
1888]]></artwork></figure>
1889<t>
1890   Chunk extensions within the chunked transfer coding are deprecated.
1891   Senders SHOULD NOT send chunk-ext.
1892   Definition of new chunk extensions is discouraged.
1893</t>
1894<t>
1895   The chunk-size field is a string of hex digits indicating the size of
1896   the chunk-data in octets. The chunked transfer coding is complete when a
1897   chunk with a chunk-size of zero is received, possibly followed by a
1898   trailer, and finally terminated by an empty line.
1899</t>
1900
1901<section title="Trailer" anchor="header.trailer">
1902  <iref primary="true" item="Trailer header field"/>
1903 
1904<t>
1905   A trailer allows the sender to include additional fields at the end of a
1906   chunked message in order to supply metadata that might be dynamically
1907   generated while the message body is sent, such as a message integrity
1908   check, digital signature, or post-processing status.
1909   The trailer MUST NOT contain fields that need to be known before a
1910   recipient processes the body, such as <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref>,
1911   <xref target="header.content-length" format="none">Content-Length</xref>, and <xref target="header.trailer" format="none">Trailer</xref>.
1912</t>
1913<t>
1914   When a message includes a message body encoded with the chunked
1915   transfer coding and the sender desires to send metadata in the form of
1916   trailer fields at the end of the message, the sender SHOULD send a
1917   <xref target="header.trailer" format="none">Trailer</xref> header field before the message body to indicate
1918   which fields will be present in the trailers. This allows the recipient
1919   to prepare for receipt of that metadata before it starts processing the body,
1920   which is useful if the message is being streamed and the recipient wishes
1921   to confirm an integrity check on the fly.
1922</t>
1923<figure><iref primary="true" item="Grammar" subitem="Trailer"/><artwork type="abnf2616"><![CDATA[
1924  Trailer = 1#field-name
1925]]></artwork></figure>
1926<t>
1927   If no <xref target="header.trailer" format="none">Trailer</xref> header field is present, the sender of a
1928   chunked message body SHOULD send an empty trailer.
1929</t>
1930<t>
1931   A server MUST send an empty trailer with the chunked transfer coding
1932   unless at least one of the following is true:
1933  <list style="numbers">
1934    <t>the request included a <xref target="header.te" format="none">TE</xref> header field that indicates
1935    "trailers" is acceptable in the transfer coding of the response, as
1936    described in <xref target="header.te"/>; or,</t>
1937     
1938    <t>the trailer fields consist entirely of optional metadata and the
1939    recipient could use the message (in a manner acceptable to the server where
1940    the field originated) without receiving that metadata. In other words,
1941    the server that generated the header field is willing to accept the
1942    possibility that the trailer fields might be silently discarded along
1943    the path to the client.</t>
1944  </list>
1945</t>
1946<t>
1947   The above requirement prevents the need for an infinite buffer when a
1948   message is being received by an HTTP/1.1 (or later) proxy and forwarded to
1949   an HTTP/1.0 recipient.
1950</t>
1951</section>
1952
1953<section title="Decoding chunked" anchor="decoding.chunked">
1954<t>
1955   A process for decoding the chunked transfer coding
1956   can be represented in pseudo-code as:
1957</t>
1958<figure><artwork type="code"><![CDATA[
1959  length := 0
1960  read chunk-size, chunk-ext (if any) and CRLF
1961  while (chunk-size > 0) {
1962     read chunk-data and CRLF
1963     append chunk-data to decoded-body
1964     length := length + chunk-size
1965     read chunk-size and CRLF
1966  }
1967  read header-field
1968  while (header-field not empty) {
1969     append header-field to existing header fields
1970     read header-field
1971  }
1972  Content-Length := length
1973  Remove "chunked" from Transfer-Encoding
1974  Remove Trailer from existing header fields
1975]]></artwork></figure>
1976<t>
1977   All recipients MUST be able to receive and decode the
1978   chunked transfer coding and MUST ignore chunk-ext extensions
1979   they do not understand.
1980</t>
1981</section>
1982</section>
1983
1984<section title="Compression Codings" anchor="compression.codings">
1985<t>
1986   The codings defined below can be used to compress the payload of a
1987   message.
1988</t>
1989
1990<section title="Compress Coding" anchor="compress.coding">
1991<iref item="compress (Coding Format)"/>
1992<t>
1993   The "compress" format is produced by the common UNIX file compression
1994   program "compress". This format is an adaptive Lempel-Ziv-Welch
1995   coding (LZW). Recipients SHOULD consider "x-compress" to be
1996   equivalent to "compress".
1997</t>
1998</section>
1999
2000<section title="Deflate Coding" anchor="deflate.coding">
2001<iref item="deflate (Coding Format)"/>
2002<t>
2003   The "deflate" format is defined as the "deflate" compression mechanism
2004   (described in <xref target="RFC1951"/>) used inside the "zlib"
2005   data format (<xref target="RFC1950"/>).
2006</t>
2007<t><list>
2008  <t>
2009    Note: Some incorrect implementations send the "deflate"
2010    compressed data without the zlib wrapper.
2011   </t>
2012</list></t>
2013</section>
2014
2015<section title="Gzip Coding" anchor="gzip.coding">
2016<iref item="gzip (Coding Format)"/>
2017<t>
2018   The "gzip" format is produced by the file compression program
2019   "gzip" (GNU zip), as described in <xref target="RFC1952"/>. This format is a
2020   Lempel-Ziv coding (LZ77) with a 32 bit CRC.
2021   Recipients SHOULD consider "x-gzip" to be equivalent to "gzip".
2022</t>
2023</section>
2024
2025</section>
2026
2027<section title="TE" anchor="header.te">
2028  <iref primary="true" item="TE header field"/>
2029 
2030 
2031 
2032 
2033<t>
2034   The "TE" header field in a request indicates what transfer codings,
2035   besides chunked, the client is willing to accept in response, and
2036   whether or not the client is willing to accept trailer fields in a
2037   chunked transfer coding.
2038</t>
2039<t>
2040   The TE field-value consists of a comma-separated list of transfer coding
2041   names, each allowing for optional parameters (as described in
2042   <xref target="transfer.codings"/>), and/or the keyword "trailers".
2043   Clients MUST NOT send the chunked transfer coding name in TE;
2044   chunked is always acceptable for HTTP/1.1 recipients.
2045</t>
2046<figure><iref primary="true" item="Grammar" subitem="TE"/><iref primary="true" item="Grammar" subitem="t-codings"/><iref primary="true" item="Grammar" subitem="t-ranking"/><iref primary="true" item="Grammar" subitem="rank"/><artwork type="abnf2616"><![CDATA[
2047  TE        = #t-codings
2048  t-codings = "trailers" / ( transfer-coding [ t-ranking ] )
2049  t-ranking = OWS ";" OWS "q=" rank
2050  rank      = ( "0" [ "." 0*3DIGIT ] )
2051             / ( "1" [ "." 0*3("0") ] )
2052]]></artwork></figure>
2053<t>
2054   Three examples of TE use are below.
2055</t>
2056<figure><artwork type="example"><![CDATA[
2057  TE: deflate
2058  TE:
2059  TE: trailers, deflate;q=0.5
2060]]></artwork></figure>
2061<t>
2062   The presence of the keyword "trailers" indicates that the client is
2063   willing to accept trailer fields in a chunked transfer coding,
2064   as defined in <xref target="chunked.encoding"/>, on behalf of itself and
2065   any downstream clients. For chained requests, this implies that either:
2066   (a) all downstream clients are willing to accept trailer fields in the
2067   forwarded response; or,
2068   (b) the client will attempt to buffer the response on behalf of downstream
2069   recipients.
2070   Note that HTTP/1.1 does not define any means to limit the size of a
2071   chunked response such that a client can be assured of buffering the
2072   entire response.
2073</t>
2074<t>
2075   When multiple transfer codings are acceptable, the client MAY rank the
2076   codings by preference using a case-insensitive "q" parameter (similar to
2077   the qvalues used in content negotiation fields, Section 5.3.1 of <xref target="Part2"/>). The rank value
2078   is a real number in the range 0 through 1, where 0.001 is the least
2079   preferred and 1 is the most preferred; a value of 0 means "not acceptable".
2080</t>
2081<t>
2082   If the TE field-value is empty or if no TE field is present, the only
2083   acceptable transfer coding is chunked. A message with no transfer coding
2084   is always acceptable.
2085</t>
2086<t>
2087   Since the TE header field only applies to the immediate connection,
2088   a sender of TE MUST also send a "TE" connection option within the
2089   <xref target="header.connection" format="none">Connection</xref> header field (<xref target="header.connection"/>)
2090   in order to prevent the TE field from being forwarded by intermediaries
2091   that do not support its semantics.
2092</t>
2093</section>
2094</section>
2095
2096<section title="Message Routing" anchor="message.routing">
2097<t>
2098   HTTP request message routing is determined by each client based on the
2099   target resource, the client's proxy configuration, and
2100   establishment or reuse of an inbound connection.  The corresponding
2101   response routing follows the same connection chain back to the client.
2102</t>
2103
2104<section title="Identifying a Target Resource" anchor="target-resource">
2105  <iref primary="true" item="target resource"/>
2106  <iref primary="true" item="target URI"/>
2107 
2108 
2109<t>
2110   HTTP is used in a wide variety of applications, ranging from
2111   general-purpose computers to home appliances.  In some cases,
2112   communication options are hard-coded in a client's configuration.
2113   However, most HTTP clients rely on the same resource identification
2114   mechanism and configuration techniques as general-purpose Web browsers.
2115</t>
2116<t>
2117   HTTP communication is initiated by a user agent for some purpose.
2118   The purpose is a combination of request semantics, which are defined in
2119   <xref target="Part2"/>, and a target resource upon which to apply those
2120   semantics.  A URI reference (<xref target="uri"/>) is typically used as
2121   an identifier for the "target resource", which a user agent
2122   would resolve to its absolute form in order to obtain the
2123   "target URI".  The target URI
2124   excludes the reference's fragment identifier component, if any,
2125   since fragment identifiers are reserved for client-side processing
2126   (<xref target="RFC3986"/>, Section 3.5).
2127</t>
2128</section>
2129
2130<section title="Connecting Inbound" anchor="connecting.inbound">
2131<t>
2132   Once the target URI is determined, a client needs to decide whether
2133   a network request is necessary to accomplish the desired semantics and,
2134   if so, where that request is to be directed.
2135</t>
2136<t>
2137   If the client has a response cache and the request semantics can be
2138   satisfied by a cache (<xref target="Part6"/>), then the request is
2139   usually directed to the cache first.
2140</t>
2141<t>
2142   If the request is not satisfied by a cache, then a typical client will
2143   check its configuration to determine whether a proxy is to be used to
2144   satisfy the request.  Proxy configuration is implementation-dependent,
2145   but is often based on URI prefix matching, selective authority matching,
2146   or both, and the proxy itself is usually identified by an "http" or
2147   "https" URI.  If a proxy is applicable, the client connects inbound by
2148   establishing (or reusing) a connection to that proxy.
2149</t>
2150<t>
2151   If no proxy is applicable, a typical client will invoke a handler routine,
2152   usually specific to the target URI's scheme, to connect directly
2153   to an authority for the target resource.  How that is accomplished is
2154   dependent on the target URI scheme and defined by its associated
2155   specification, similar to how this specification defines origin server
2156   access for resolution of the "http" (<xref target="http.uri"/>) and
2157   "https" (<xref target="https.uri"/>) schemes.
2158</t>
2159<t>
2160   HTTP requirements regarding connection management are defined in
2161   <xref target="connection.management"/>.
2162</t>
2163</section>
2164
2165<section title="Request Target" anchor="request-target">
2166<t>
2167   Once an inbound connection is obtained,
2168   the client sends an HTTP request message (<xref target="http.message"/>)
2169   with a request-target derived from the target URI.
2170   There are four distinct formats for the request-target, depending on both
2171   the method being requested and whether the request is to a proxy.
2172</t>   
2173<figure><iref primary="true" item="Grammar" subitem="request-target"/><iref primary="true" item="Grammar" subitem="origin-form"/><iref primary="true" item="Grammar" subitem="absolute-form"/><iref primary="true" item="Grammar" subitem="authority-form"/><iref primary="true" item="Grammar" subitem="asterisk-form"/><artwork type="abnf2616"><![CDATA[
2174  request-target = origin-form
2175                 / absolute-form
2176                 / authority-form
2177                 / asterisk-form
2178
2179  origin-form    = absolute-path [ "?" query ]
2180  absolute-form  = absolute-URI
2181  authority-form = authority
2182  asterisk-form  = "*"
2183]]></artwork></figure>
2184<t anchor="origin-form"><iref item="origin-form (of request-target)"/>
2185  origin-form
2186</t>
2187<t>
2188   The most common form of request-target is the origin-form.
2189   When making a request directly to an origin server, other than a CONNECT
2190   or server-wide OPTIONS request (as detailed below),
2191   a client MUST send only the absolute path and query components of
2192   the target URI as the request-target.
2193   If the target URI's path component is empty, then the client MUST send
2194   "/" as the path within the origin-form of request-target.
2195   A <xref target="header.host" format="none">Host</xref> header field is also sent, as defined in
2196   <xref target="header.host"/>, containing the target URI's
2197   authority component (excluding any userinfo).
2198</t>
2199<t>
2200   For example, a client wishing to retrieve a representation of the resource
2201   identified as
2202</t>
2203<figure><artwork type="example"><![CDATA[
2204  http://www.example.org/where?q=now
2205  ]]></artwork></figure>
2206<t>
2207   directly from the origin server would open (or reuse) a TCP connection
2208   to port 80 of the host "www.example.org" and send the lines:
2209</t>
2210<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2211  GET /where?q=now HTTP/1.1
2212  Host: www.example.org
2213  ]]></artwork></figure>
2214<t>
2215   followed by the remainder of the request message.
2216</t>
2217<t anchor="absolute-form"><iref item="absolute-form (of request-target)"/>
2218  absolute-form
2219</t>
2220<t>
2221   When making a request to a proxy, other than a CONNECT or server-wide
2222   OPTIONS request (as detailed below), a client MUST send the target URI
2223   in absolute-form as the request-target.
2224   The proxy is requested to either service that request from a valid cache,
2225   if possible, or make the same request on the client's behalf to either
2226   the next inbound proxy server or directly to the origin server indicated
2227   by the request-target.  Requirements on such "forwarding" of messages are
2228   defined in <xref target="message.forwarding"/>.
2229</t>
2230<t>
2231   An example absolute-form of request-line would be:
2232</t>
2233<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2234  GET http://www.example.org/pub/WWW/TheProject.html HTTP/1.1
2235  ]]></artwork></figure>
2236<t>
2237   To allow for transition to the absolute-form for all requests in some
2238   future version of HTTP, HTTP/1.1 servers MUST accept the absolute-form
2239   in requests, even though HTTP/1.1 clients will only send them in requests
2240   to proxies.
2241</t>
2242<t anchor="authority-form"><iref item="authority-form (of request-target)"/>
2243  authority-form
2244</t>
2245<t>
2246   The authority-form of request-target is only used for CONNECT requests
2247   (Section 4.3.6 of <xref target="Part2"/>).  When making a CONNECT request to establish a tunnel through
2248   one or more proxies, a client MUST send only the target URI's
2249   authority component (excluding any userinfo) as the request-target.
2250   For example,
2251</t>
2252<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2253  CONNECT www.example.com:80 HTTP/1.1
2254  ]]></artwork></figure>
2255<t anchor="asterisk-form"><iref item="asterisk-form (of request-target)"/>
2256  asterisk-form
2257</t>
2258<t>
2259   The asterisk-form of request-target is only used for a server-wide
2260   OPTIONS request (Section 4.3.7 of <xref target="Part2"/>).  When a client wishes to request OPTIONS
2261   for the server as a whole, as opposed to a specific named resource of
2262   that server, the client MUST send only "*" (%x2A) as the request-target.
2263   For example,
2264</t>
2265<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2266  OPTIONS * HTTP/1.1
2267  ]]></artwork></figure>
2268<t>
2269   If a proxy receives an OPTIONS request with an absolute-form of
2270   request-target in which the URI has an empty path and no query component,
2271   then the last proxy on the request chain MUST send a request-target
2272   of "*" when it forwards the request to the indicated origin server.
2273</t>
2274<figure><preamble>  
2275   For example, the request
2276</preamble><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2277  OPTIONS http://www.example.org:8001 HTTP/1.1
2278  ]]></artwork></figure>
2279<figure><preamble>  
2280  would be forwarded by the final proxy as
2281</preamble><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2282  OPTIONS * HTTP/1.1
2283  Host: www.example.org:8001
2284  ]]></artwork>
2285<postamble>
2286   after connecting to port 8001 of host "www.example.org".
2287</postamble>
2288</figure>
2289</section>
2290
2291<section title="Host" anchor="header.host">
2292  <iref primary="true" item="Host header field"/>
2293 
2294<t>
2295   The "Host" header field in a request provides the host and port
2296   information from the target URI, enabling the origin
2297   server to distinguish among resources while servicing requests
2298   for multiple host names on a single IP address.  Since the Host
2299   field-value is critical information for handling a request, it
2300   SHOULD be sent as the first header field following the request-line.
2301</t>
2302<figure><iref primary="true" item="Grammar" subitem="Host"/><artwork type="abnf2616"><![CDATA[
2303  Host = uri-host [ ":" port ] ; Section 2.7.1
2304]]></artwork></figure>
2305<t>
2306   A client MUST send a Host header field in all HTTP/1.1 request
2307   messages.  If the target URI includes an authority component, then
2308   the Host field-value MUST be identical to that authority component
2309   after excluding any userinfo (<xref target="http.uri"/>).
2310   If the authority component is missing or undefined for the target URI,
2311   then the Host header field MUST be sent with an empty field-value.
2312</t>
2313<t>
2314   For example, a GET request to the origin server for
2315   &lt;http://www.example.org/pub/WWW/&gt; would begin with:
2316</t>
2317<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2318  GET /pub/WWW/ HTTP/1.1
2319  Host: www.example.org
2320  ]]></artwork></figure>
2321<t>
2322   The Host header field MUST be sent in an HTTP/1.1 request even
2323   if the request-target is in the absolute-form, since this
2324   allows the Host information to be forwarded through ancient HTTP/1.0
2325   proxies that might not have implemented Host.
2326</t>
2327<t>
2328   When a proxy receives a request with an absolute-form of
2329   request-target, the proxy MUST ignore the received
2330   Host header field (if any) and instead replace it with the host
2331   information of the request-target.  If the proxy forwards the request,
2332   it MUST generate a new Host field-value based on the received
2333   request-target rather than forward the received Host field-value.
2334</t>
2335<t>
2336   Since the Host header field acts as an application-level routing
2337   mechanism, it is a frequent target for malware seeking to poison
2338   a shared cache or redirect a request to an unintended server.
2339   An interception proxy is particularly vulnerable if it relies on
2340   the Host field-value for redirecting requests to internal
2341   servers, or for use as a cache key in a shared cache, without
2342   first verifying that the intercepted connection is targeting a
2343   valid IP address for that host.
2344</t>
2345<t>
2346   A server MUST respond with a 400 (Bad Request) status code
2347   to any HTTP/1.1 request message that lacks a Host header field and
2348   to any request message that contains more than one Host header field
2349   or a Host header field with an invalid field-value.
2350</t>
2351</section>
2352
2353<section title="Effective Request URI" anchor="effective.request.uri">
2354  <iref primary="true" item="effective request URI"/>
2355 
2356<t>
2357   A server that receives an HTTP request message MUST reconstruct
2358   the user agent's original target URI, based on the pieces of information
2359   learned from the request-target, <xref target="header.host" format="none">Host</xref> header field, and
2360   connection context, in order to identify the intended target resource and
2361   properly service the request. The URI derived from this reconstruction
2362   process is referred to as the "effective request URI".
2363</t>
2364<t>
2365   For a user agent, the effective request URI is the target URI.
2366</t>
2367<t>
2368   If the request-target is in absolute-form, then the effective request URI
2369   is the same as the request-target.  Otherwise, the effective request URI
2370   is constructed as follows.
2371</t>
2372<t>
2373   If the request is received over a TLS-secured TCP connection,
2374   then the effective request URI's scheme is "https"; otherwise, the
2375   scheme is "http".
2376</t>
2377<t>
2378   If the request-target is in authority-form, then the effective
2379   request URI's authority component is the same as the request-target.
2380   Otherwise, if a <xref target="header.host" format="none">Host</xref> header field is supplied with a
2381   non-empty field-value, then the authority component is the same as the
2382   Host field-value. Otherwise, the authority component is the concatenation of
2383   the default host name configured for the server, a colon (":"), and the
2384   connection's incoming TCP port number in decimal form.
2385</t>
2386<t>
2387   If the request-target is in authority-form or asterisk-form, then the
2388   effective request URI's combined path and query component is empty.
2389   Otherwise, the combined path and query component is the same as the
2390   request-target.
2391</t>
2392<t>
2393   The components of the effective request URI, once determined as above,
2394   can be combined into absolute-URI form by concatenating the scheme,
2395   "://", authority, and combined path and query component.
2396</t>
2397<figure>
2398<preamble>
2399   Example 1: the following message received over an insecure TCP connection
2400</preamble>
2401<artwork type="example"><![CDATA[
2402  GET /pub/WWW/TheProject.html HTTP/1.1
2403  Host: www.example.org:8080
2404  ]]></artwork>
2405</figure>
2406<figure>
2407<preamble>
2408  has an effective request URI of
2409</preamble>
2410<artwork type="example"><![CDATA[
2411  http://www.example.org:8080/pub/WWW/TheProject.html
2412  ]]></artwork>
2413</figure>
2414<figure>
2415<preamble>
2416   Example 2: the following message received over a TLS-secured TCP connection
2417</preamble>
2418<artwork type="example"><![CDATA[
2419  OPTIONS * HTTP/1.1
2420  Host: www.example.org
2421  ]]></artwork>
2422</figure>
2423<figure>
2424<preamble>
2425  has an effective request URI of
2426</preamble>
2427<artwork type="example"><![CDATA[
2428  https://www.example.org
2429  ]]></artwork>
2430</figure>
2431<t>
2432   An origin server that does not allow resources to differ by requested
2433   host MAY ignore the <xref target="header.host" format="none">Host</xref> field-value and instead replace it
2434   with a configured server name when constructing the effective request URI.
2435</t>
2436<t>
2437   Recipients of an HTTP/1.0 request that lacks a <xref target="header.host" format="none">Host</xref> header
2438   field MAY attempt to use heuristics (e.g., examination of the URI path for
2439   something unique to a particular host) in order to guess the
2440   effective request URI's authority component.
2441</t>
2442</section>
2443
2444<section title="Associating a Response to a Request" anchor="associating.response.to.request">
2445<t>
2446   HTTP does not include a request identifier for associating a given
2447   request message with its corresponding one or more response messages.
2448   Hence, it relies on the order of response arrival to correspond exactly
2449   to the order in which requests are made on the same connection.
2450   More than one response message per request only occurs when one or more
2451   informational responses (1xx, see Section 6.2 of <xref target="Part2"/>) precede a
2452   final response to the same request.
2453</t>
2454<t>
2455   A client that has more than one outstanding request on a connection MUST
2456   maintain a list of outstanding requests in the order sent and MUST
2457   associate each received response message on that connection to the highest
2458   ordered request that has not yet received a final (non-1xx)
2459   response.
2460</t>
2461</section>
2462
2463<section title="Message Forwarding" anchor="message.forwarding">
2464<t>
2465   As described in <xref target="intermediaries"/>, intermediaries can serve
2466   a variety of roles in the processing of HTTP requests and responses.
2467   Some intermediaries are used to improve performance or availability.
2468   Others are used for access control or to filter content.
2469   Since an HTTP stream has characteristics similar to a pipe-and-filter
2470   architecture, there are no inherent limits to the extent an intermediary
2471   can enhance (or interfere) with either direction of the stream.
2472</t>
2473<t>
2474   Intermediaries that forward a message MUST implement the
2475   <xref target="header.connection" format="none">Connection</xref> header field, as specified in
2476   <xref target="header.connection"/>, to exclude fields that are only
2477   intended for the incoming connection.
2478</t>
2479<t>
2480   In order to avoid request loops, a proxy that forwards requests to other
2481   proxies MUST be able to recognize and exclude all of its own server
2482   names, including any aliases, local variations, or literal IP addresses.
2483</t>
2484
2485<section title="Via" anchor="header.via">
2486  <iref primary="true" item="Via header field"/>
2487 
2488 
2489 
2490 
2491<t>
2492   The "Via" header field MUST be sent by a proxy or gateway in forwarded
2493   messages to indicate the intermediate protocols and recipients between the
2494   user agent and the server on requests, and between the origin server and
2495   the client on responses. It is analogous to the "Received" field
2496   used by email systems (Section 3.6.7 of <xref target="RFC5322"/>).
2497   Via is used in HTTP for tracking message forwards,
2498   avoiding request loops, and identifying the protocol capabilities of
2499   all senders along the request/response chain.
2500</t>
2501<figure><iref primary="true" item="Grammar" subitem="Via"/><iref primary="true" item="Grammar" subitem="received-protocol"/><iref primary="true" item="Grammar" subitem="protocol-name"/><iref primary="true" item="Grammar" subitem="protocol-version"/><iref primary="true" item="Grammar" subitem="received-by"/><iref primary="true" item="Grammar" subitem="pseudonym"/><artwork type="abnf2616"><![CDATA[
2502  Via               = 1#( received-protocol RWS received-by
2503                          [ RWS comment ] )
2504  received-protocol = [ protocol-name "/" ] protocol-version
2505                      ; see Section 6.7
2506  received-by       = ( uri-host [ ":" port ] ) / pseudonym
2507  pseudonym         = token
2508]]></artwork></figure>
2509<t>
2510   The received-protocol indicates the protocol version of the message
2511   received by the server or client along each segment of the
2512   request/response chain. The received-protocol version is appended to
2513   the Via field value when the message is forwarded so that information
2514   about the protocol capabilities of upstream applications remains
2515   visible to all recipients.
2516</t>
2517<t>
2518   The protocol-name is excluded if and only if it would be "HTTP". The
2519   received-by field is normally the host and optional port number of a
2520   recipient server or client that subsequently forwarded the message.
2521   However, if the real host is considered to be sensitive information,
2522   it MAY be replaced by a pseudonym. If the port is not given, it MAY
2523   be assumed to be the default port of the received-protocol.
2524</t>
2525<t>
2526   Multiple Via field values represent each proxy or gateway that has
2527   forwarded the message. Each recipient MUST append its information
2528   such that the end result is ordered according to the sequence of
2529   forwarding applications.
2530</t>
2531<t>
2532   Comments MAY be used in the Via header field to identify the software
2533   of each recipient, analogous to the User-Agent and
2534   Server header fields. However, all comments in the Via field
2535   are optional and MAY be removed by any recipient prior to forwarding the
2536   message.
2537</t>
2538<t>
2539   For example, a request message could be sent from an HTTP/1.0 user
2540   agent to an internal proxy code-named "fred", which uses HTTP/1.1 to
2541   forward the request to a public proxy at p.example.net, which completes
2542   the request by forwarding it to the origin server at www.example.com.
2543   The request received by www.example.com would then have the following
2544   Via header field:
2545</t>
2546<figure><artwork type="example"><![CDATA[
2547  Via: 1.0 fred, 1.1 p.example.net (Apache/1.1)
2548]]></artwork></figure>
2549<t>
2550   A proxy or gateway used as a portal through a network firewall
2551   SHOULD NOT forward the names and ports of hosts within the firewall
2552   region unless it is explicitly enabled to do so. If not enabled, the
2553   received-by host of any host behind the firewall SHOULD be replaced
2554   by an appropriate pseudonym for that host.
2555</t>
2556<t>
2557   A proxy or gateway MAY combine an ordered subsequence of Via header
2558   field entries into a single such entry if the entries have identical
2559   received-protocol values. For example,
2560</t>
2561<figure><artwork type="example"><![CDATA[
2562  Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy
2563]]></artwork></figure>
2564<t>
2565  could be collapsed to
2566</t>
2567<figure><artwork type="example"><![CDATA[
2568  Via: 1.0 ricky, 1.1 mertz, 1.0 lucy
2569]]></artwork></figure>
2570<t>
2571   Senders SHOULD NOT combine multiple entries unless they are all
2572   under the same organizational control and the hosts have already been
2573   replaced by pseudonyms. Senders MUST NOT combine entries that
2574   have different received-protocol values.
2575</t>
2576</section>
2577
2578<section title="Transformations" anchor="message.transformations">
2579<t>
2580   Some intermediaries include features for transforming messages and their
2581   payloads.  A transforming proxy might, for example, convert between image
2582   formats in order to save cache space or to reduce the amount of traffic on
2583   a slow link. However, operational problems might occur when these
2584   transformations are applied to payloads intended for critical applications,
2585   such as medical imaging or scientific data analysis, particularly when
2586   integrity checks or digital signatures are used to ensure that the payload
2587   received is identical to the original.
2588</t>
2589<t>
2590   If a proxy receives a request-target with a host name that is not a
2591   fully qualified domain name, it MAY add its own domain to the host name
2592   it received when forwarding the request.  A proxy MUST NOT change the
2593   host name if it is a fully qualified domain name.
2594</t>
2595<t>
2596   A proxy MUST NOT modify the "absolute-path" and "query" parts of the
2597   received request-target when forwarding it to the next inbound server,
2598   except as noted above to replace an empty path with "/" or "*".
2599</t>
2600<t>
2601   A proxy MUST NOT modify header fields that provide information about the
2602   end points of the communication chain, the resource state, or the selected
2603   representation. A proxy MAY change the message body through application
2604   or removal of a transfer coding (<xref target="transfer.codings"/>).
2605</t>
2606<t>
2607   A non-transforming proxy MUST preserve the message payload (Section 3.3 of <xref target="Part2"/>).
2608   A transforming proxy MUST preserve the payload of a message that
2609   contains the no-transform cache-control directive.
2610</t>
2611<t>
2612   A transforming proxy MAY transform the payload of a message
2613   that does not contain the no-transform cache-control directive;
2614   if the payload is transformed, the transforming proxy MUST add a
2615   Warning 214 (Transformation applied) header field if one does not
2616   already appear in the message (see Section 7.5 of <xref target="Part6"/>).
2617</t>
2618</section>
2619</section>
2620</section>
2621
2622<section title="Connection Management" anchor="connection.management">
2623<t>
2624   HTTP messaging is independent of the underlying transport or
2625   session-layer connection protocol(s).  HTTP only presumes a reliable
2626   transport with in-order delivery of requests and the corresponding
2627   in-order delivery of responses.  The mapping of HTTP request and
2628   response structures onto the data units of an underlying transport
2629   protocol is outside the scope of this specification.
2630</t>
2631<t>
2632   As described in <xref target="connecting.inbound"/>, the specific
2633   connection protocols to be used for an HTTP interaction are determined by
2634   client configuration and the <xref target="target-resource" format="none">target URI</xref>.
2635   For example, the "http" URI scheme
2636   (<xref target="http.uri"/>) indicates a default connection of TCP
2637   over IP, with a default TCP port of 80, but the client might be
2638   configured to use a proxy via some other connection, port, or protocol.
2639</t>
2640<t>
2641   HTTP implementations are expected to engage in connection management,
2642   which includes maintaining the state of current connections,
2643   establishing a new connection or reusing an existing connection,
2644   processing messages received on a connection, detecting connection
2645   failures, and closing each connection.
2646   Most clients maintain multiple connections in parallel, including
2647   more than one connection per server endpoint.
2648   Most servers are designed to maintain thousands of concurrent connections,
2649   while controlling request queues to enable fair use and detect
2650   denial of service attacks.
2651</t>
2652
2653<section title="Connection" anchor="header.connection">
2654  <iref primary="true" item="Connection header field"/>
2655  <iref primary="true" item="close"/>
2656 
2657 
2658 
2659<t>
2660   The "Connection" header field allows the sender to indicate desired
2661   control options for the current connection.  In order to avoid confusing
2662   downstream recipients, a proxy or gateway MUST remove or replace any
2663   received connection options before forwarding the message.
2664</t>
2665<t>
2666   When a header field aside from Connection is used to supply control
2667   information for or about the current connection, the sender MUST list
2668   the corresponding field-name within the "Connection" header field.
2669   A proxy or gateway MUST parse a received Connection
2670   header field before a message is forwarded and, for each
2671   connection-option in this field, remove any header field(s) from
2672   the message with the same name as the connection-option, and then
2673   remove the Connection header field itself (or replace it with the
2674   intermediary's own connection options for the forwarded message).
2675</t>
2676<t>
2677   Hence, the Connection header field provides a declarative way of
2678   distinguishing header fields that are only intended for the
2679   immediate recipient ("hop-by-hop") from those fields that are
2680   intended for all recipients on the chain ("end-to-end"), enabling the
2681   message to be self-descriptive and allowing future connection-specific
2682   extensions to be deployed without fear that they will be blindly
2683   forwarded by older intermediaries.
2684</t>
2685<t>
2686   The Connection header field's value has the following grammar:
2687</t>
2688<figure><iref primary="true" item="Grammar" subitem="Connection"/><iref primary="true" item="Grammar" subitem="connection-option"/><artwork type="abnf2616"><![CDATA[
2689  Connection        = 1#connection-option
2690  connection-option = token
2691]]></artwork></figure>
2692<t>
2693   Connection options are case-insensitive.
2694</t>
2695<t>
2696   A sender MUST NOT send a connection option corresponding to a header
2697   field that is intended for all recipients of the payload.
2698   For example, Cache-Control is never appropriate as a
2699   connection option (Section 7.2 of <xref target="Part6"/>).
2700</t>
2701<t>
2702   The connection options do not have to correspond to a header field
2703   present in the message, since a connection-specific header field
2704   might not be needed if there are no parameters associated with that
2705   connection option.  Recipients that trigger certain connection
2706   behavior based on the presence of connection options MUST do so
2707   based on the presence of the connection-option rather than only the
2708   presence of the optional header field.  In other words, if the
2709   connection option is received as a header field but not indicated
2710   within the Connection field-value, then the recipient MUST ignore
2711   the connection-specific header field because it has likely been
2712   forwarded by an intermediary that is only partially conformant.
2713</t>
2714<t>
2715   When defining new connection options, specifications ought to
2716   carefully consider existing deployed header fields and ensure
2717   that the new connection option does not share the same name as
2718   an unrelated header field that might already be deployed.
2719   Defining a new connection option essentially reserves that potential
2720   field-name for carrying additional information related to the
2721   connection option, since it would be unwise for senders to use
2722   that field-name for anything else.
2723</t>
2724<t>
2725   The "close" connection option is defined for a
2726   sender to signal that this connection will be closed after completion of
2727   the response. For example,
2728</t>
2729<figure><artwork type="example"><![CDATA[
2730  Connection: close
2731]]></artwork></figure>
2732<t>
2733   in either the request or the response header fields indicates that
2734   the connection MUST be closed after the current request/response
2735   is complete (<xref target="persistent.tear-down"/>).
2736</t>
2737<t>
2738   A client that does not support <xref target="persistent.connections" format="none">persistent connections</xref> MUST
2739   send the "close" connection option in every request message.
2740</t>
2741<t>
2742   A server that does not support <xref target="persistent.connections" format="none">persistent connections</xref> MUST
2743   send the "close" connection option in every response message that
2744   does not have a 1xx (Informational) status code.
2745</t>
2746</section>
2747
2748<section title="Establishment" anchor="persistent.establishment">
2749<t>
2750   It is beyond the scope of this specification to describe how connections
2751   are established via various transport or session-layer protocols.
2752   Each connection applies to only one transport link.
2753</t>
2754</section>
2755
2756<section title="Persistence" anchor="persistent.connections">
2757   
2758<t>
2759   HTTP/1.1 defaults to the use of "persistent connections",
2760   allowing multiple requests and responses to be carried over a single
2761   connection. The "<xref target="header.connection" format="none">close</xref>" connection-option is used to signal
2762   that a connection will not persist after the current request/response.
2763   HTTP implementations SHOULD support persistent connections.
2764</t>
2765<t>
2766   A recipient determines whether a connection is persistent or not based on
2767   the most recently received message's protocol version and
2768   <xref target="header.connection" format="none">Connection</xref> header field (if any):
2769   <list style="symbols">
2770     <t>If the <xref target="header.connection" format="none">close</xref> connection option is present, the
2771        connection will not persist after the current response; else,</t>
2772     <t>If the received protocol is HTTP/1.1 (or later), the connection will
2773        persist after the current response; else,</t>
2774     <t>If the received protocol is HTTP/1.0, the "keep-alive"
2775        connection option is present, the recipient is not a proxy, and
2776        the recipient wishes to honor the HTTP/1.0 "keep-alive" mechanism,
2777        the connection will persist after the current response; otherwise,</t>
2778     <t>The connection will close after the current response.</t>
2779   </list>
2780</t>
2781<t>
2782   A server MAY assume that an HTTP/1.1 client intends to maintain a
2783   persistent connection until a <xref target="header.connection" format="none">close</xref> connection option
2784   is received in a request.
2785</t>
2786<t>
2787   A client MAY reuse a persistent connection until it sends or receives
2788   a <xref target="header.connection" format="none">close</xref> connection option or receives an HTTP/1.0 response
2789   without a "keep-alive" connection option.
2790</t>
2791<t>
2792   In order to remain persistent, all messages on a connection MUST
2793   have a self-defined message length (i.e., one not defined by closure
2794   of the connection), as described in <xref target="message.body"/>.
2795   A server MUST read the entire request message body or close
2796   the connection after sending its response, since otherwise the
2797   remaining data on a persistent connection would be misinterpreted
2798   as the next request.  Likewise,
2799   a client MUST read the entire response message body if it intends
2800   to reuse the same connection for a subsequent request.
2801</t>
2802<t>
2803   A proxy server MUST NOT maintain a persistent connection with an
2804   HTTP/1.0 client (see Section 19.7.1 of <xref target="RFC2068"/> for
2805   information and discussion of the problems with the Keep-Alive header field
2806   implemented by many HTTP/1.0 clients).
2807</t>
2808<t>
2809   Clients and servers SHOULD NOT assume that a persistent connection is
2810   maintained for HTTP versions less than 1.1 unless it is explicitly
2811   signaled.
2812   See <xref target="compatibility.with.http.1.0.persistent.connections"/>
2813   for more information on backward compatibility with HTTP/1.0 clients.
2814</t>
2815
2816<section title="Retrying Requests" anchor="persistent.retrying.requests">
2817<t>
2818   Connections can be closed at any time, with or without intention.
2819   Implementations ought to anticipate the need to recover
2820   from asynchronous close events.
2821</t>
2822<t>
2823   When an inbound connection is closed prematurely, a client MAY open a new
2824   connection and automatically retransmit an aborted sequence of requests if
2825   all of those requests have idempotent methods (Section 4.2.2 of <xref target="Part2"/>).
2826   A proxy MUST NOT automatically retry non-idempotent requests.
2827</t>
2828<t>
2829   A user agent MUST NOT automatically retry a request with a non-idempotent
2830   method unless it has some means to know that the request semantics are
2831   actually idempotent, regardless of the method, or some means to detect that
2832   the original request was never applied. For example, a user agent that
2833   knows (through design or configuration) that a POST request to a given
2834   resource is safe can repeat that request automatically.
2835   Likewise, a user agent designed specifically to operate on a version
2836   control repository might be able to recover from partial failure conditions
2837   by checking the target resource revision(s) after a failed connection,
2838   reverting or fixing any changes that were partially applied, and then
2839   automatically retrying the requests that failed.
2840</t>
2841<t>
2842   An automatic retry SHOULD NOT be repeated if it fails.
2843</t>
2844</section>
2845
2846<section title="Pipelining" anchor="pipelining">
2847   
2848<t>
2849   A client that supports persistent connections MAY "pipeline"
2850   its requests (i.e., send multiple requests without waiting for each
2851   response). A server MAY process a sequence of pipelined requests in
2852   parallel if they all have safe methods (Section 4.2.1 of <xref target="Part2"/>), but MUST send
2853   the corresponding responses in the same order that the requests were
2854   received.
2855</t>
2856<t>
2857   A client that pipelines requests MUST be prepared to retry those
2858   requests if the connection closes before it receives all of the
2859   corresponding responses. A client that assumes a persistent connection and
2860   pipelines immediately after connection establishment MUST NOT pipeline
2861   on a retry connection until it knows the connection is persistent.
2862</t>
2863<t>
2864   Idempotent methods (Section 4.2.2 of <xref target="Part2"/>) are significant to pipelining
2865   because they can be automatically retried after a connection failure.
2866   A user agent SHOULD NOT pipeline requests after a non-idempotent method
2867   until the final response status code for that method has been received,
2868   unless the user agent has a means to detect and recover from partial
2869   failure conditions involving the pipelined sequence.
2870</t>
2871<t>
2872   An intermediary that receives pipelined requests MAY pipeline those
2873   requests when forwarding them inbound, since it can rely on the outbound
2874   user agent(s) to determine what requests can be safely pipelined. If the
2875   inbound connection fails before receiving a response, the pipelining
2876   intermediary MAY attempt to retry a sequence of requests that have yet
2877   to receive a response if the requests all have idempotent methods;
2878   otherwise, the pipelining intermediary SHOULD forward any received
2879   responses and then close the corresponding outbound connection(s) so that
2880   the outbound user agent(s) can recover accordingly.
2881</t>
2882</section>
2883</section>
2884   
2885<section title="Concurrency" anchor="persistent.concurrency">
2886<t>
2887   Clients SHOULD limit the number of simultaneous
2888   connections that they maintain to a given server.
2889</t>
2890<t>
2891   Previous revisions of HTTP gave a specific number of connections as a
2892   ceiling, but this was found to be impractical for many applications. As a
2893   result, this specification does not mandate a particular maximum number of
2894   connections, but instead encourages clients to be conservative when opening
2895   multiple connections.
2896</t>
2897<t>
2898   Multiple connections are typically used to avoid the "head-of-line
2899   blocking" problem, wherein a request that takes significant server-side
2900   processing and/or has a large payload blocks subsequent requests on the
2901   same connection. However, each connection consumes server resources.
2902   Furthermore, using multiple connections can cause undesirable side effects
2903   in congested networks.
2904</t>
2905<t>
2906   Note that servers might reject traffic that they deem abusive, including an
2907   excessive number of connections from a client.
2908</t>
2909</section>
2910
2911<section title="Failures and Time-outs" anchor="persistent.failures">
2912<t>
2913   Servers will usually have some time-out value beyond which they will
2914   no longer maintain an inactive connection. Proxy servers might make
2915   this a higher value since it is likely that the client will be making
2916   more connections through the same server. The use of persistent
2917   connections places no requirements on the length (or existence) of
2918   this time-out for either the client or the server.
2919</t>
2920<t>
2921   When a client or server wishes to time-out it SHOULD issue a graceful
2922   close on the transport connection. Clients and servers SHOULD both
2923   constantly watch for the other side of the transport close, and
2924   respond to it as appropriate. If a client or server does not detect
2925   the other side's close promptly it could cause unnecessary resource
2926   drain on the network.
2927</t>
2928<t>
2929   A client, server, or proxy MAY close the transport connection at any
2930   time. For example, a client might have started to send a new request
2931   at the same time that the server has decided to close the "idle"
2932   connection. From the server's point of view, the connection is being
2933   closed while it was idle, but from the client's point of view, a
2934   request is in progress.
2935</t>
2936<t>
2937   Servers SHOULD maintain persistent connections and allow the underlying
2938   transport's flow control mechanisms to resolve temporary overloads, rather
2939   than terminate connections with the expectation that clients will retry.
2940   The latter technique can exacerbate network congestion.
2941</t>
2942<t>
2943   A client sending a message body SHOULD monitor
2944   the network connection for an error status code while it is transmitting
2945   the request. If the client sees an error status code, it SHOULD
2946   immediately cease transmitting the body and close the connection.
2947</t>
2948</section>
2949   
2950<section title="Tear-down" anchor="persistent.tear-down">
2951  <iref primary="false" item="Connection header field"/>
2952  <iref primary="false" item="close"/>
2953<t>
2954   The <xref target="header.connection" format="none">Connection</xref> header field
2955   (<xref target="header.connection"/>) provides a "<xref target="header.connection" format="none">close</xref>"
2956   connection option that a sender SHOULD send when it wishes to close
2957   the connection after the current request/response pair.
2958</t>
2959<t>
2960   A client that sends a <xref target="header.connection" format="none">close</xref> connection option MUST NOT
2961   send further requests on that connection (after the one containing
2962   <xref target="header.connection" format="none">close</xref>) and MUST close the connection after reading the
2963   final response message corresponding to this request.
2964</t>
2965<t>
2966   A server that receives a <xref target="header.connection" format="none">close</xref> connection option MUST
2967   initiate a lingering close (see below) of the connection after it sends the
2968   final response to the request that contained <xref target="header.connection" format="none">close</xref>.
2969   The server SHOULD send a <xref target="header.connection" format="none">close</xref> connection option
2970   in its final response on that connection. The server MUST NOT process
2971   any further requests received on that connection.
2972</t>
2973<t>
2974   A server that sends a <xref target="header.connection" format="none">close</xref> connection option MUST
2975   initiate a lingering close of the connection after it sends the
2976   response containing <xref target="header.connection" format="none">close</xref>. The server MUST NOT process
2977   any further requests received on that connection.
2978</t>
2979<t>
2980   A client that receives a <xref target="header.connection" format="none">close</xref> connection option MUST
2981   cease sending requests on that connection and close the connection
2982   after reading the response message containing the close; if additional
2983   pipelined requests had been sent on the connection, the client SHOULD
2984   assume that they will not be processed by the server.
2985</t>
2986<t>
2987   If a server performs an immediate close of a TCP connection, there is a
2988   significant risk that the client will not be able to read the last HTTP
2989   response.  If the server receives additional data from the client on a
2990   fully-closed connection, such as another request that was sent by the
2991   client before receiving the server's response, the server's TCP stack will
2992   send a reset packet to the client; unfortunately, the reset packet might
2993   erase the client's unacknowledged input buffers before they can be read
2994   and interpreted by the client's HTTP parser.
2995</t>
2996<t>
2997   To avoid the TCP reset problem, a server can perform a lingering close on a
2998   connection by closing only the write side of the read/write connection
2999   (a half-close) and continuing to read from the connection until the
3000   connection is closed by the client or the server is reasonably certain
3001   that its own TCP stack has received the client's acknowledgement of the
3002   packet(s) containing the server's last response. It is then safe for the
3003   server to fully close the connection.
3004</t>
3005<t>
3006   It is unknown whether the reset problem is exclusive to TCP or might also
3007   be found in other transport connection protocols.
3008</t>
3009</section>
3010
3011<section title="Upgrade" anchor="header.upgrade">
3012  <iref primary="true" item="Upgrade header field"/>
3013 
3014 
3015 
3016 
3017<t>
3018   The "Upgrade" header field is intended to provide a simple mechanism
3019   for transitioning from HTTP/1.1 to some other protocol on the same
3020   connection.  A client MAY send a list of protocols in the Upgrade
3021   header field of a request to invite the server to switch to one or
3022   more of those protocols before sending the final response.
3023   A server MUST send an Upgrade header field in 101 (Switching
3024   Protocols) responses to indicate which protocol(s) are being
3025   switched to, and MUST send it in 426 (Upgrade Required)
3026   responses to indicate acceptable protocols.
3027   A server MAY send an Upgrade header field in any other response to
3028   indicate that they might be willing to upgrade to one of the
3029   specified protocols for a future request.
3030</t>
3031<figure><iref primary="true" item="Grammar" subitem="Upgrade"/><artwork type="abnf2616"><![CDATA[
3032  Upgrade          = 1#protocol
3033
3034  protocol         = protocol-name ["/" protocol-version]
3035  protocol-name    = token
3036  protocol-version = token
3037]]></artwork></figure>
3038<t>
3039   For example,
3040</t>
3041<figure><artwork type="example"><![CDATA[
3042  Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
3043]]></artwork></figure>
3044<t>
3045   Upgrade eases the difficult transition between incompatible protocols by
3046   allowing the client to initiate a request in the more commonly
3047   supported protocol while indicating to the server that it would like
3048   to use a "better" protocol if available (where "better" is determined
3049   by the server, possibly according to the nature of the request method
3050   or target resource).
3051</t>
3052<t>
3053   Upgrade cannot be used to insist on a protocol change; its acceptance and
3054   use by the server is optional. The capabilities and nature of the
3055   application-level communication after the protocol change is entirely
3056   dependent upon the new protocol chosen, although the first action
3057   after changing the protocol MUST be a response to the initial HTTP
3058   request that contained the Upgrade header field.
3059</t>
3060<t>
3061   For example, if the Upgrade header field is received in a GET request
3062   and the server decides to switch protocols, then it first responds
3063   with a 101 (Switching Protocols) message in HTTP/1.1 and
3064   then immediately follows that with the new protocol's equivalent of a
3065   response to a GET on the target resource.  This allows a connection to be
3066   upgraded to protocols with the same semantics as HTTP without the
3067   latency cost of an additional round-trip.  A server MUST NOT switch
3068   protocols unless the received message semantics can be honored by the new
3069   protocol; an OPTIONS request can be honored by any protocol.
3070</t>
3071<t>
3072   When Upgrade is sent, a sender MUST also send a
3073   <xref target="header.connection" format="none">Connection</xref> header field (<xref target="header.connection"/>)
3074   that contains the "upgrade" connection option, in order to prevent Upgrade
3075   from being accidentally forwarded by intermediaries that might not implement
3076   the listed protocols.  A server MUST ignore an Upgrade header field that
3077   is received in an HTTP/1.0 request.
3078</t>
3079<t>
3080   The Upgrade header field only applies to switching application-level
3081   protocols on the existing connection; it cannot be used
3082   to switch to a protocol on a different connection. For that purpose, it is
3083   more appropriate to use a 3xx (Redirection) response
3084   (Section 6.4 of <xref target="Part2"/>).
3085</t>
3086<t>
3087   This specification only defines the protocol name "HTTP" for use by
3088   the family of Hypertext Transfer Protocols, as defined by the HTTP
3089   version rules of <xref target="http.version"/> and future updates to this
3090   specification. Additional tokens ought to be registered with IANA using the
3091   registration procedure defined in <xref target="upgrade.token.registry"/>.
3092</t>
3093</section>
3094</section>
3095
3096<section title="IANA Considerations" anchor="IANA.considerations">
3097
3098<section title="Header Field Registration" anchor="header.field.registration">
3099<t>
3100   HTTP header fields are registered within the Message Header Field Registry
3101   <xref target="BCP90"/> maintained by IANA at
3102   <eref target="http://www.iana.org/assignments/message-headers/message-header-index.html"/>.
3103</t>
3104<t>
3105   This document defines the following HTTP header fields, so their
3106   associated registry entries shall be updated according to the permanent
3107   registrations below:
3108</t>
3109
3110<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
3111<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
3112   <ttcol>Header Field Name</ttcol>
3113   <ttcol>Protocol</ttcol>
3114   <ttcol>Status</ttcol>
3115   <ttcol>Reference</ttcol>
3116
3117   <c>Connection</c>
3118   <c>http</c>
3119   <c>standard</c>
3120   <c>
3121      <xref target="header.connection"/>
3122   </c>
3123   <c>Content-Length</c>
3124   <c>http</c>
3125   <c>standard</c>
3126   <c>
3127      <xref target="header.content-length"/>
3128   </c>
3129   <c>Host</c>
3130   <c>http</c>
3131   <c>standard</c>
3132   <c>
3133      <xref target="header.host"/>
3134   </c>
3135   <c>TE</c>
3136   <c>http</c>
3137   <c>standard</c>
3138   <c>
3139      <xref target="header.te"/>
3140   </c>
3141   <c>Trailer</c>
3142   <c>http</c>
3143   <c>standard</c>
3144   <c>
3145      <xref target="header.trailer"/>
3146   </c>
3147   <c>Transfer-Encoding</c>
3148   <c>http</c>
3149   <c>standard</c>
3150   <c>
3151      <xref target="header.transfer-encoding"/>
3152   </c>
3153   <c>Upgrade</c>
3154   <c>http</c>
3155   <c>standard</c>
3156   <c>
3157      <xref target="header.upgrade"/>
3158   </c>
3159   <c>Via</c>
3160   <c>http</c>
3161   <c>standard</c>
3162   <c>
3163      <xref target="header.via"/>
3164   </c>
3165</texttable>
3166<!--(END)-->
3167
3168<t>
3169   Furthermore, the header field-name "Close" shall be registered as
3170   "reserved", since using that name as an HTTP header field might
3171   conflict with the "close" connection option of the "<xref target="header.connection" format="none">Connection</xref>"
3172   header field (<xref target="header.connection"/>).
3173</t>
3174<texttable align="left" suppress-title="true">
3175   <ttcol>Header Field Name</ttcol>
3176   <ttcol>Protocol</ttcol>
3177   <ttcol>Status</ttcol>
3178   <ttcol>Reference</ttcol>
3179
3180   <c>Close</c>
3181   <c>http</c>
3182   <c>reserved</c>
3183   <c>
3184      <xref target="header.field.registration"/>
3185   </c>
3186</texttable>
3187<t>
3188   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
3189</t>
3190</section>
3191
3192<section title="URI Scheme Registration" anchor="uri.scheme.registration">
3193<t>
3194   IANA maintains the registry of URI Schemes <xref target="BCP115"/> at
3195   <eref target="http://www.iana.org/assignments/uri-schemes.html"/>.
3196</t>
3197<t>
3198   This document defines the following URI schemes, so their
3199   associated registry entries shall be updated according to the permanent
3200   registrations below:
3201</t>
3202<texttable align="left" suppress-title="true">
3203   <ttcol>URI Scheme</ttcol>
3204   <ttcol>Description</ttcol>
3205   <ttcol>Reference</ttcol>
3206
3207   <c>http</c>
3208   <c>Hypertext Transfer Protocol</c>
3209   <c><xref target="http.uri"/></c>
3210
3211   <c>https</c>
3212   <c>Hypertext Transfer Protocol Secure</c>
3213   <c><xref target="https.uri"/></c>
3214</texttable>
3215</section>
3216
3217<section title="Internet Media Type Registration" anchor="internet.media.type.http">
3218<t>
3219   This document serves as the specification for the Internet media types
3220   "message/http" and "application/http". The following is to be registered with
3221   IANA (see <xref target="BCP13"/>).
3222</t>
3223<section title="Internet Media Type message/http" anchor="internet.media.type.message.http">
3224<iref item="Media Type" subitem="message/http" primary="true"/>
3225<iref item="message/http Media Type" primary="true"/>
3226<t>
3227   The message/http type can be used to enclose a single HTTP request or
3228   response message, provided that it obeys the MIME restrictions for all
3229   "message" types regarding line length and encodings.
3230</t>
3231<t>
3232  <list style="hanging">
3233    <t hangText="Type name:">
3234      message
3235    </t>
3236    <t hangText="Subtype name:">
3237      http
3238    </t>
3239    <t hangText="Required parameters:">
3240      none
3241    </t>
3242    <t hangText="Optional parameters:">
3243      version, msgtype
3244      <list style="hanging">
3245        <t hangText="version:">
3246          The HTTP-version number of the enclosed message
3247          (e.g., "1.1"). If not present, the version can be
3248          determined from the first line of the body.
3249        </t>
3250        <t hangText="msgtype:">
3251          The message type — "request" or "response". If not
3252          present, the type can be determined from the first
3253          line of the body.
3254        </t>
3255      </list>
3256    </t>
3257    <t hangText="Encoding considerations:">
3258      only "7bit", "8bit", or "binary" are permitted
3259    </t>
3260    <t hangText="Security considerations:">
3261      none
3262    </t>
3263    <t hangText="Interoperability considerations:">
3264      none
3265    </t>
3266    <t hangText="Published specification:">
3267      This specification (see <xref target="internet.media.type.message.http"/>).
3268    </t>
3269    <t hangText="Applications that use this media type:">
3270    </t>
3271    <t hangText="Additional information:">
3272      <list style="hanging">
3273        <t hangText="Magic number(s):">none</t>
3274        <t hangText="File extension(s):">none</t>
3275        <t hangText="Macintosh file type code(s):">none</t>
3276      </list>
3277    </t>
3278    <t hangText="Person and email address to contact for further information:">
3279      See Authors Section.
3280    </t>
3281    <t hangText="Intended usage:">
3282      COMMON
3283    </t>
3284    <t hangText="Restrictions on usage:">
3285      none
3286    </t>
3287    <t hangText="Author/Change controller:">
3288      IESG
3289    </t>
3290  </list>
3291</t>
3292</section>
3293<section title="Internet Media Type application/http" anchor="internet.media.type.application.http">
3294<iref item="Media Type" subitem="application/http" primary="true"/>
3295<iref item="application/http Media Type" primary="true"/>
3296<t>
3297   The application/http type can be used to enclose a pipeline of one or more
3298   HTTP request or response messages (not intermixed).
3299</t>
3300<t>
3301  <list style="hanging">
3302    <t hangText="Type name:">
3303      application
3304    </t>
3305    <t hangText="Subtype name:">
3306      http
3307    </t>
3308    <t hangText="Required parameters:">
3309      none
3310    </t>
3311    <t hangText="Optional parameters:">
3312      version, msgtype
3313      <list style="hanging">
3314        <t hangText="version:">
3315          The HTTP-version number of the enclosed messages
3316          (e.g., "1.1"). If not present, the version can be
3317          determined from the first line of the body.
3318        </t>
3319        <t hangText="msgtype:">
3320          The message type — "request" or "response". If not
3321          present, the type can be determined from the first
3322          line of the body.
3323        </t>
3324      </list>
3325    </t>
3326    <t hangText="Encoding considerations:">
3327      HTTP messages enclosed by this type
3328      are in "binary" format; use of an appropriate
3329      Content-Transfer-Encoding is required when
3330      transmitted via E-mail.
3331    </t>
3332    <t hangText="Security considerations:">
3333      none
3334    </t>
3335    <t hangText="Interoperability considerations:">
3336      none
3337    </t>
3338    <t hangText="Published specification:">
3339      This specification (see <xref target="internet.media.type.application.http"/>).
3340    </t>
3341    <t hangText="Applications that use this media type:">
3342    </t>
3343    <t hangText="Additional information:">
3344      <list style="hanging">
3345        <t hangText="Magic number(s):">none</t>
3346        <t hangText="File extension(s):">none</t>
3347        <t hangText="Macintosh file type code(s):">none</t>
3348      </list>
3349    </t>
3350    <t hangText="Person and email address to contact for further information:">
3351      See Authors Section.
3352    </t>
3353    <t hangText="Intended usage:">
3354      COMMON
3355    </t>
3356    <t hangText="Restrictions on usage:">
3357      none
3358    </t>
3359    <t hangText="Author/Change controller:">
3360      IESG
3361    </t>
3362  </list>
3363</t>
3364</section>
3365</section>
3366
3367<section title="Transfer Coding Registry" anchor="transfer.coding.registry">
3368<t>
3369   The HTTP Transfer Coding Registry defines the name space for transfer
3370   coding names.
3371</t>
3372<t>
3373   Registrations MUST include the following fields:
3374   <list style="symbols">
3375     <t>Name</t>
3376     <t>Description</t>
3377     <t>Pointer to specification text</t>
3378   </list>
3379</t>
3380<t>
3381   Names of transfer codings MUST NOT overlap with names of content codings
3382   (Section 3.1.2.1 of <xref target="Part2"/>) unless the encoding transformation is identical, as
3383   is the case for the compression codings defined in
3384   <xref target="compression.codings"/>.
3385</t>
3386<t>
3387   Values to be added to this name space require IETF Review (see
3388   Section 4.1 of <xref target="RFC5226"/>), and MUST
3389   conform to the purpose of transfer coding defined in this section.
3390   Use of program names for the identification of encoding formats
3391   is not desirable and is discouraged for future encodings.
3392</t>
3393<t>
3394   The registry itself is maintained at
3395   <eref target="http://www.iana.org/assignments/http-parameters"/>.
3396</t>
3397</section>
3398
3399<section title="Transfer Coding Registration" anchor="transfer.coding.registration">
3400<t>
3401   The HTTP Transfer Coding Registry shall be updated with the registrations
3402   below:
3403</t>
3404<texttable align="left" suppress-title="true" anchor="iana.transfer.coding.registration.table">
3405   <ttcol>Name</ttcol>
3406   <ttcol>Description</ttcol>
3407   <ttcol>Reference</ttcol>
3408   <c>chunked</c>
3409   <c>Transfer in a series of chunks</c>
3410   <c>
3411      <xref target="chunked.encoding"/>
3412   </c>
3413   <c>compress</c>
3414   <c>UNIX "compress" program method</c>
3415   <c>
3416      <xref target="compress.coding"/>
3417   </c>
3418   <c>deflate</c>
3419   <c>"deflate" compression mechanism (<xref target="RFC1951"/>) used inside
3420   the "zlib" data format (<xref target="RFC1950"/>)
3421   </c>
3422   <c>
3423      <xref target="deflate.coding"/>
3424   </c>
3425   <c>gzip</c>
3426   <c>Same as GNU zip <xref target="RFC1952"/></c>
3427   <c>
3428      <xref target="gzip.coding"/>
3429   </c>
3430</texttable>
3431</section>
3432
3433<section title="Upgrade Token Registry" anchor="upgrade.token.registry">
3434<t>
3435   The HTTP Upgrade Token Registry defines the name space for protocol-name
3436   tokens used to identify protocols in the <xref target="header.upgrade" format="none">Upgrade</xref> header
3437   field. Each registered protocol name is associated with contact information
3438   and an optional set of specifications that details how the connection
3439   will be processed after it has been upgraded.
3440</t>
3441<t>
3442   Registrations happen on a "First Come First Served" basis (see
3443   Section 4.1 of <xref target="RFC5226"/>) and are subject to the
3444   following rules:
3445  <list style="numbers">
3446    <t>A protocol-name token, once registered, stays registered forever.</t>
3447    <t>The registration MUST name a responsible party for the
3448       registration.</t>
3449    <t>The registration MUST name a point of contact.</t>
3450    <t>The registration MAY name a set of specifications associated with
3451       that token. Such specifications need not be publicly available.</t>
3452    <t>The registration SHOULD name a set of expected "protocol-version"
3453       tokens associated with that token at the time of registration.</t>
3454    <t>The responsible party MAY change the registration at any time.
3455       The IANA will keep a record of all such changes, and make them
3456       available upon request.</t>
3457    <t>The IESG MAY reassign responsibility for a protocol token.
3458       This will normally only be used in the case when a
3459       responsible party cannot be contacted.</t>
3460  </list>
3461</t>
3462<t>
3463   This registration procedure for HTTP Upgrade Tokens replaces that
3464   previously defined in Section 7.2 of <xref target="RFC2817"/>.
3465</t>
3466</section>
3467
3468<section title="Upgrade Token Registration" anchor="upgrade.token.registration">
3469<t>
3470   The HTTP Upgrade Token Registry shall be updated with the registration
3471   below:
3472</t>
3473<texttable align="left" suppress-title="true">
3474   <ttcol>Value</ttcol>
3475   <ttcol>Description</ttcol>
3476   <ttcol>Expected Version Tokens</ttcol>
3477   <ttcol>Reference</ttcol>
3478
3479   <c>HTTP</c>
3480   <c>Hypertext Transfer Protocol</c>
3481   <c>any DIGIT.DIGIT (e.g, "2.0")</c>
3482   <c><xref target="http.version"/></c>
3483</texttable>
3484<t>
3485   The responsible party is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".
3486</t>
3487</section>
3488
3489</section>
3490
3491<section title="Security Considerations" anchor="security.considerations">
3492<t>
3493   This section is meant to inform developers, information providers, and
3494   users of known security concerns relevant to HTTP/1.1 message syntax,
3495   parsing, and routing.
3496</t>
3497
3498<section title="DNS-related Attacks" anchor="dns.related.attacks">
3499<t>
3500   HTTP clients rely heavily on the Domain Name Service (DNS), and are thus
3501   generally prone to security attacks based on the deliberate misassociation
3502   of IP addresses and DNS names not protected by DNSSEC. Clients need to be
3503   cautious in assuming the validity of an IP number/DNS name association unless
3504   the response is protected by DNSSEC (<xref target="RFC4033"/>).
3505</t>
3506</section>
3507
3508<section title="Intermediaries and Caching" anchor="attack.intermediaries">
3509<t>
3510   By their very nature, HTTP intermediaries are men-in-the-middle, and
3511   represent an opportunity for man-in-the-middle attacks. Compromise of
3512   the systems on which the intermediaries run can result in serious security
3513   and privacy problems. Intermediaries have access to security-related
3514   information, personal information about individual users and
3515   organizations, and proprietary information belonging to users and
3516   content providers. A compromised intermediary, or an intermediary
3517   implemented or configured without regard to security and privacy
3518   considerations, might be used in the commission of a wide range of
3519   potential attacks.
3520</t>
3521<t>
3522   Intermediaries that contain a shared cache are especially vulnerable
3523   to cache poisoning attacks.
3524</t>
3525<t>
3526   Implementers need to consider the privacy and security
3527   implications of their design and coding decisions, and of the
3528   configuration options they provide to operators (especially the
3529   default configuration).
3530</t>
3531<t>
3532   Users need to be aware that intermediaries are no more trustworthy than
3533   the people who run them; HTTP itself cannot solve this problem.
3534</t>
3535</section>
3536
3537<section title="Buffer Overflows" anchor="attack.protocol.element.size.overflows">
3538<t>
3539   Because HTTP uses mostly textual, character-delimited fields, attackers can
3540   overflow buffers in implementations, and/or perform a Denial of Service
3541   against implementations that accept fields with unlimited lengths.
3542</t>
3543<t>
3544   To promote interoperability, this specification makes specific
3545   recommendations for minimum size limits on request-line
3546   (<xref target="request.line"/>)
3547   and blocks of header fields (<xref target="header.fields"/>). These are
3548   minimum recommendations, chosen to be supportable even by implementations
3549   with limited resources; it is expected that most implementations will
3550   choose substantially higher limits.
3551</t>
3552<t>
3553   This specification also provides a way for servers to reject messages that
3554   have request-targets that are too long (Section 6.5.12 of <xref target="Part2"/>) or request entities
3555   that are too large (Section 6.5 of <xref target="Part2"/>).
3556</t>
3557<t>
3558   Recipients SHOULD carefully limit the extent to which they read other
3559   fields, including (but not limited to) request methods, response status
3560   phrases, header field-names, and body chunks, so as to avoid denial of
3561   service attacks without impeding interoperability.
3562</t>
3563</section>
3564
3565<section title="Message Integrity" anchor="message.integrity">
3566<t>
3567   HTTP does not define a specific mechanism for ensuring message integrity,
3568   instead relying on the error-detection ability of underlying transport
3569   protocols and the use of length or chunk-delimited framing to detect
3570   completeness. Additional integrity mechanisms, such as hash functions or
3571   digital signatures applied to the content, can be selectively added to
3572   messages via extensible metadata header fields. Historically, the lack of
3573   a single integrity mechanism has been justified by the informal nature of
3574   most HTTP communication.  However, the prevalence of HTTP as an information
3575   access mechanism has resulted in its increasing use within environments
3576   where verification of message integrity is crucial.
3577</t>
3578<t>
3579   User agents are encouraged to implement configurable means for detecting
3580   and reporting failures of message integrity such that those means can be
3581   enabled within environments for which integrity is necessary. For example,
3582   a browser being used to view medical history or drug interaction
3583   information needs to indicate to the user when such information is detected
3584   by the protocol to be incomplete, expired, or corrupted during transfer.
3585   Such mechanisms might be selectively enabled via user agent extensions or
3586   the presence of message integrity metadata in a response.
3587   At a minimum, user agents ought to provide some indication that allows a
3588   user to distinguish between a complete and incomplete response message
3589   (<xref target="incomplete.messages"/>) when such verification is desired.
3590</t>
3591</section>
3592
3593<section title="Server Log Information" anchor="abuse.of.server.log.information">
3594<t>
3595   A server is in the position to save personal data about a user's requests
3596   over time, which might identify their reading patterns or subjects of
3597   interest.  In particular, log information gathered at an intermediary
3598   often contains a history of user agent interaction, across a multitude
3599   of sites, that can be traced to individual users.
3600</t>
3601<t>
3602   HTTP log information is confidential in nature; its handling is often
3603   constrained by laws and regulations.  Log information needs to be securely
3604   stored and appropriate guidelines followed for its analysis.
3605   Anonymization of personal information within individual entries helps,
3606   but is generally not sufficient to prevent real log traces from being
3607   re-identified based on correlation with other access characteristics.
3608   As such, access traces that are keyed to a specific client should not
3609   be published even if the key is pseudonymous.
3610</t>
3611<t>
3612   To minimize the risk of theft or accidental publication, log information
3613   should be purged of personally identifiable information, including
3614   user identifiers, IP addresses, and user-provided query parameters,
3615   as soon as that information is no longer necessary to support operational
3616   needs for security, auditing, or fraud control.
3617</t>
3618</section>
3619</section>
3620
3621<section title="Acknowledgments" anchor="acks">
3622<t>
3623   This edition of HTTP/1.1 builds on the many contributions that went into
3624   <xref target="RFC1945" format="none">RFC 1945</xref>,
3625   <xref target="RFC2068" format="none">RFC 2068</xref>,
3626   <xref target="RFC2145" format="none">RFC 2145</xref>, and
3627   <xref target="RFC2616" format="none">RFC 2616</xref>, including
3628   substantial contributions made by the previous authors, editors, and
3629   working group chairs: Tim Berners-Lee, Ari Luotonen, Roy T. Fielding,
3630   Henrik Frystyk Nielsen, Jim Gettys, Jeffrey C. Mogul, Larry Masinter,
3631   and Paul J. Leach. Mark Nottingham oversaw this effort as working group chair.
3632</t>
3633<t>
3634   Since 1999, the following contributors have helped improve the HTTP
3635   specification by reporting bugs, asking smart questions, drafting or
3636   reviewing text, and evaluating open issues:
3637</t>
3638
3639<t>Adam Barth,
3640Adam Roach,
3641Addison Phillips,
3642Adrian Chadd,
3643Adrien W. de Croy,
3644Alan Ford,
3645Alan Ruttenberg,
3646Albert Lunde,
3647Alek Storm,
3648Alex Rousskov,
3649Alexandre Morgaut,
3650Alexey Melnikov,
3651Alisha Smith,
3652Amichai Rothman,
3653Amit Klein,
3654Amos Jeffries,
3655Andreas Maier,
3656Andreas Petersson,
3657Anil Sharma,
3658Anne van Kesteren,
3659Anthony Bryan,
3660Asbjorn Ulsberg,
3661Ashok Kumar,
3662Balachander Krishnamurthy,
3663Barry Leiba,
3664Ben Laurie,
3665Benjamin Niven-Jenkins,
3666Bil Corry,
3667Bill Burke,
3668Bjoern Hoehrmann,
3669Bob Scheifler,
3670Boris Zbarsky,
3671Brett Slatkin,
3672Brian Kell,
3673Brian McBarron,
3674Brian Pane,
3675Brian Smith,
3676Bryce Nesbitt,
3677Cameron Heavon-Jones,
3678Carl Kugler,
3679Carsten Bormann,
3680Charles Fry,
3681Chris Newman,
3682Chris Weber,
3683Cyrus Daboo,
3684Dale Robert Anderson,
3685Dan Wing,
3686Dan Winship,
3687Daniel Stenberg,
3688Darrel Miller,
3689Dave Cridland,
3690Dave Crocker,
3691Dave Kristol,
3692David Booth,
3693David Singer,
3694David W. Morris,
3695Diwakar Shetty,
3696Dmitry Kurochkin,
3697Drummond Reed,
3698Duane Wessels,
3699Duncan Cragg,
3700Edward Lee,
3701Eliot Lear,
3702Eran Hammer-Lahav,
3703Eric D. Williams,
3704Eric J. Bowman,
3705Eric Lawrence,
3706Eric Rescorla,
3707Erik Aronesty,
3708Evan Prodromou,
3709Florian Weimer,
3710Frank Ellermann,
3711Fred Bohle,
3712Gabriel Montenegro,
3713Geoffrey Sneddon,
3714Gervase Markham,
3715Grahame Grieve,
3716Greg Wilkins,
3717Harald Tveit Alvestrand,
3718Harry Halpin,
3719Helge Hess,
3720Henrik Nordstrom,
3721Henry S. Thompson,
3722Henry Story,
3723Herbert van de Sompel,
3724Howard Melman,
3725Hugo Haas,
3726Ian Fette,
3727Ian Hickson,
3728Ido Safruti,
3729Ilya Grigorik,
3730Ingo Struck,
3731J. Ross Nicoll,
3732James H. Manger,
3733James Lacey,
3734James M. Snell,
3735Jamie Lokier,
3736Jan Algermissen,
3737Jeff Hodges (who came up with the term 'effective Request-URI'),
3738Jeff Walden,
3739Jeroen de Borst,
3740Jim Luther,
3741Joe D. Williams,
3742Joe Gregorio,
3743Joe Orton,
3744John C. Klensin,
3745John C. Mallery,
3746John Cowan,
3747John Kemp,
3748John Panzer,
3749John Schneider,
3750John Stracke,
3751John Sullivan,
3752Jonas Sicking,
3753Jonathan A. Rees,
3754Jonathan Billington,
3755Jonathan Moore,
3756Jonathan Rees,
3757Jonathan Silvera,
3758Jordi Ros,
3759Joris Dobbelsteen,
3760Josh Cohen,
3761Julien Pierre,
3762Jungshik Shin,
3763Justin Chapweske,
3764Justin Erenkrantz,
3765Justin James,
3766Kalvinder Singh,
3767Karl Dubost,
3768Keith Hoffman,
3769Keith Moore,
3770Ken Murchison,
3771Koen Holtman,
3772Konstantin Voronkov,
3773Kris Zyp,
3774Lisa Dusseault,
3775Maciej Stachowiak,
3776Marc Schneider,
3777Marc Slemko,
3778Mark Baker,
3779Mark Pauley,
3780Mark Watson,
3781Markus Isomaki,
3782Markus Lanthaler,
3783Martin J. Duerst,
3784Martin Musatov,
3785Martin Nilsson,
3786Martin Thomson,
3787Matt Lynch,
3788Matthew Cox,
3789Max Clark,
3790Michael Burrows,
3791Michael Hausenblas,
3792Mike Amundsen,
3793Mike Belshe,
3794Mike Kelly,
3795Mike Schinkel,
3796Miles Sabin,
3797Murray S. Kucherawy,
3798Mykyta Yevstifeyev,
3799Nathan Rixham,
3800Nicholas Shanks,
3801Nico Williams,
3802Nicolas Alvarez,
3803Nicolas Mailhot,
3804Noah Slater,
3805Pablo Castro,
3806Pat Hayes,
3807Patrick R. McManus,
3808Patrik Faltstrom,
3809Paul E. Jones,
3810Paul Hoffman,
3811Paul Marquess,
3812Peter Lepeska,
3813Peter Saint-Andre,
3814Peter Watkins,
3815Phil Archer,
3816Philippe Mougin,
3817Phillip Hallam-Baker,
3818Poul-Henning Kamp,
3819Preethi Natarajan,
3820Rajeev Bector,
3821Ray Polk,
3822Reto Bachmann-Gmuer,
3823Richard Cyganiak,
3824Robert Brewer,
3825Robert Collins,
3826Robert O'Callahan,
3827Robert Olofsson,
3828Robert Sayre,
3829Robert Siemer,
3830Robert de Wilde,
3831Roberto Javier Godoy,
3832Roberto Peon,
3833Roland Zink,
3834Ronny Widjaja,
3835S. Mike Dierken,
3836Salvatore Loreto,
3837Sam Johnston,
3838Sam Ruby,
3839Scott Lawrence (who maintained the original issues list),
3840Sean B. Palmer,
3841Shane McCarron,
3842Stefan Eissing,
3843Stefan Tilkov,
3844Stefanos Harhalakis,
3845Stephane Bortzmeyer,
3846Stephen Farrell,
3847Stephen Ludin,
3848Stuart Williams,
3849Subbu Allamaraju,
3850Subramanian Moonesamy,
3851Sylvain Hellegouarch,
3852Tapan Divekar,
3853Tatsuya Hayashi,
3854Ted Hardie,
3855Thomas Broyer,
3856Thomas Fossati,
3857Thomas Nordin,
3858Thomas Roessler,
3859Tim Bray,
3860Tim Morgan,
3861Tim Olsen,
3862Tobias Oberstein,
3863Tom Zhou,
3864Travis Snoozy,
3865Tyler Close,
3866Vincent Murphy,
3867Wenbo Zhu,
3868Werner Baumann,
3869Wilbur Streett,
3870Wilfredo Sanchez Vega,
3871William A. Rowe Jr.,
3872William Chan,
3873Willy Tarreau,
3874Xiaoshu Wang,
3875Yaron Goland,
3876Yngve Nysaeter Pettersen,
3877Yoav Nir,
3878Yogesh Bang,
3879Yutaka Oiwa,
3880Yves Lafon (long-time member of the editor team),
3881Zed A. Shaw, and
3882Zhong Yu.
3883</t>
3884
3885<t>
3886   See Section 16 of <xref target="RFC2616"/> for additional
3887   acknowledgements from prior revisions.
3888</t>
3889</section>
3890
3891</middle>
3892<back>
3893
3894<references title="Normative References">
3895
3896<reference anchor="Part2">
3897  <front>
3898    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
3899    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
3900      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
3901      <address><email>fielding@gbiv.com</email></address>
3902    </author>
3903    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
3904      <organization abbrev="greenbytes">greenbytes GmbH</organization>
3905      <address><email>julian.reschke@greenbytes.de</email></address>
3906    </author>
3907    <date month="February" year="2013"/>
3908  </front>
3909  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-22"/>
3910 
3911</reference>
3912
3913<reference anchor="Part4">
3914  <front>
3915    <title>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>
3916    <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
3917      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
3918      <address><email>fielding@gbiv.com</email></address>
3919    </author>
3920    <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
3921      <organization abbrev="greenbytes">greenbytes GmbH</organization>
3922      <address><email>julian.reschke@greenbytes.de</email></address>
3923    </author>
3924    <date month="February" year="2013"/>
3925  </front>
3926  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-22"/>
3927 
3928</reference>
3929
3930<reference anchor="Part5">
3931  <front>
3932    <title>Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>
3933    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
3934      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
3935      <address><email>fielding@gbiv.com</email></address>
3936    </author>
3937    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
3938      <organization abbrev="W3C">World Wide Web Consortium</organization>
3939      <address><email>ylafon@w3.org</email></address>
3940    </author>
3941    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
3942      <organization abbrev="greenbytes">greenbytes GmbH</organization>
3943      <address><email>julian.reschke@greenbytes.de</email></address>
3944    </author>
3945    <date month="February" year="2013"/>
3946  </front>
3947  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-22"/>
3948 
3949</reference>
3950
3951<reference anchor="Part6">
3952  <front>
3953    <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
3954    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
3955      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
3956      <address><email>fielding@gbiv.com</email></address>
3957    </author>
3958    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
3959      <organization>Akamai</organization>
3960      <address><email>mnot@mnot.net</email></address>
3961    </author>
3962    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
3963      <organization abbrev="greenbytes">greenbytes GmbH</organization>
3964      <address><email>julian.reschke@greenbytes.de</email></address>
3965    </author>
3966    <date month="February" year="2013"/>
3967  </front>
3968  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-22"/>
3969 
3970</reference>
3971
3972<reference anchor="Part7">
3973  <front>
3974    <title>Hypertext Transfer Protocol (HTTP/1.1): Authentication</title>
3975    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
3976      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
3977      <address><email>fielding@gbiv.com</email></address>
3978    </author>
3979    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
3980      <organization abbrev="greenbytes">greenbytes GmbH</organization>
3981      <address><email>julian.reschke@greenbytes.de</email></address>
3982    </author>
3983    <date month="February" year="2013"/>
3984  </front>
3985  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p7-auth-22"/>
3986 
3987</reference>
3988
3989<reference anchor="RFC5234">
3990  <front>
3991    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
3992    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
3993      <organization>Brandenburg InternetWorking</organization>
3994      <address>
3995        <email>dcrocker@bbiw.net</email>
3996      </address> 
3997    </author>
3998    <author initials="P." surname="Overell" fullname="Paul Overell">
3999      <organization>THUS plc.</organization>
4000      <address>
4001        <email>paul.overell@thus.net</email>
4002      </address>
4003    </author>
4004    <date month="January" year="2008"/>
4005  </front>
4006  <seriesInfo name="STD" value="68"/>
4007  <seriesInfo name="RFC" value="5234"/>
4008</reference>
4009
4010<reference anchor="RFC2119">
4011  <front>
4012    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
4013    <author initials="S." surname="Bradner" fullname="Scott Bradner">
4014      <organization>Harvard University</organization>
4015      <address><email>sob@harvard.edu</email></address>
4016    </author>
4017    <date month="March" year="1997"/>
4018  </front>
4019  <seriesInfo name="BCP" value="14"/>
4020  <seriesInfo name="RFC" value="2119"/>
4021</reference>
4022
4023<reference anchor="RFC3986">
4024 <front>
4025  <title abbrev="URI Generic Syntax">Uniform Resource Identifier (URI): Generic Syntax</title>
4026  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4027    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
4028    <address>
4029       <email>timbl@w3.org</email>
4030       <uri>http://www.w3.org/People/Berners-Lee/</uri>
4031    </address>
4032  </author>
4033  <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
4034    <organization abbrev="Day Software">Day Software</organization>
4035    <address>
4036      <email>fielding@gbiv.com</email>
4037      <uri>http://roy.gbiv.com/</uri>
4038    </address>
4039  </author>
4040  <author initials="L." surname="Masinter" fullname="Larry Masinter">
4041    <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
4042    <address>
4043      <email>LMM@acm.org</email>
4044      <uri>http://larry.masinter.net/</uri>
4045    </address>
4046  </author>
4047  <date month="January" year="2005"/>
4048 </front>
4049 <seriesInfo name="STD" value="66"/>
4050 <seriesInfo name="RFC" value="3986"/>
4051</reference>
4052
4053<reference anchor="USASCII">
4054  <front>
4055    <title>Coded Character Set -- 7-bit American Standard Code for Information Interchange</title>
4056    <author>
4057      <organization>American National Standards Institute</organization>
4058    </author>
4059    <date year="1986"/>
4060  </front>
4061  <seriesInfo name="ANSI" value="X3.4"/>
4062</reference>
4063
4064<reference anchor="RFC1950">
4065  <front>
4066    <title>ZLIB Compressed Data Format Specification version 3.3</title>
4067    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4068      <organization>Aladdin Enterprises</organization>
4069      <address><email>ghost@aladdin.com</email></address>
4070    </author>
4071    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly"/>
4072    <date month="May" year="1996"/>
4073  </front>
4074  <seriesInfo name="RFC" value="1950"/>
4075  <!--<annotation>
4076    RFC 1950 is an Informational RFC, thus it might be less stable than
4077    this specification. On the other hand, this downward reference was
4078    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4079    therefore it is unlikely to cause problems in practice. See also
4080    <xref target="BCP97"/>.
4081  </annotation>-->
4082</reference>
4083
4084<reference anchor="RFC1951">
4085  <front>
4086    <title>DEFLATE Compressed Data Format Specification version 1.3</title>
4087    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4088      <organization>Aladdin Enterprises</organization>
4089      <address><email>ghost@aladdin.com</email></address>
4090    </author>
4091    <date month="May" year="1996"/>
4092  </front>
4093  <seriesInfo name="RFC" value="1951"/>
4094  <!--<annotation>
4095    RFC 1951 is an Informational RFC, thus it might be less stable than
4096    this specification. On the other hand, this downward reference was
4097    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4098    therefore it is unlikely to cause problems in practice. See also
4099    <xref target="BCP97"/>.
4100  </annotation>-->
4101</reference>
4102
4103<reference anchor="RFC1952">
4104  <front>
4105    <title>GZIP file format specification version 4.3</title>
4106    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4107      <organization>Aladdin Enterprises</organization>
4108      <address><email>ghost@aladdin.com</email></address>
4109    </author>
4110    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
4111      <address><email>gzip@prep.ai.mit.edu</email></address>
4112    </author>
4113    <author initials="M." surname="Adler" fullname="Mark Adler">
4114      <address><email>madler@alumni.caltech.edu</email></address>
4115    </author>
4116    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4117      <address><email>ghost@aladdin.com</email></address>
4118    </author>
4119    <author initials="G." surname="Randers-Pehrson" fullname="Glenn Randers-Pehrson">
4120      <address><email>randeg@alumni.rpi.edu</email></address>
4121    </author>
4122    <date month="May" year="1996"/>
4123  </front>
4124  <seriesInfo name="RFC" value="1952"/>
4125  <!--<annotation>
4126    RFC 1952 is an Informational RFC, thus it might be less stable than
4127    this specification. On the other hand, this downward reference was
4128    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4129    therefore it is unlikely to cause problems in practice. See also
4130    <xref target="BCP97"/>.
4131  </annotation>-->
4132</reference>
4133
4134</references>
4135
4136<references title="Informative References">
4137
4138<reference anchor="ISO-8859-1">
4139  <front>
4140    <title>
4141     Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1
4142    </title>
4143    <author>
4144      <organization>International Organization for Standardization</organization>
4145    </author>
4146    <date year="1998"/>
4147  </front>
4148  <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
4149</reference>
4150
4151<reference anchor="RFC1919">
4152  <front>
4153    <title>Classical versus Transparent IP Proxies</title>
4154    <author initials="M." surname="Chatel" fullname="Marc Chatel">
4155      <address><email>mchatel@pax.eunet.ch</email></address>
4156    </author>
4157    <date year="1996" month="March"/>
4158  </front>
4159  <seriesInfo name="RFC" value="1919"/>
4160</reference>
4161
4162<reference anchor="RFC1945">
4163  <front>
4164    <title abbrev="HTTP/1.0">Hypertext Transfer Protocol -- HTTP/1.0</title>
4165    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4166      <organization>MIT, Laboratory for Computer Science</organization>
4167      <address><email>timbl@w3.org</email></address>
4168    </author>
4169    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4170      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4171      <address><email>fielding@ics.uci.edu</email></address>
4172    </author>
4173    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4174      <organization>W3 Consortium, MIT Laboratory for Computer Science</organization>
4175      <address><email>frystyk@w3.org</email></address>
4176    </author>
4177    <date month="May" year="1996"/>
4178  </front>
4179  <seriesInfo name="RFC" value="1945"/>
4180</reference>
4181
4182<reference anchor="RFC2045">
4183  <front>
4184    <title abbrev="Internet Message Bodies">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
4185    <author initials="N." surname="Freed" fullname="Ned Freed">
4186      <organization>Innosoft International, Inc.</organization>
4187      <address><email>ned@innosoft.com</email></address>
4188    </author>
4189    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
4190      <organization>First Virtual Holdings</organization>
4191      <address><email>nsb@nsb.fv.com</email></address>
4192    </author>
4193    <date month="November" year="1996"/>
4194  </front>
4195  <seriesInfo name="RFC" value="2045"/>
4196</reference>
4197
4198<reference anchor="RFC2047">
4199  <front>
4200    <title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title>
4201    <author initials="K." surname="Moore" fullname="Keith Moore">
4202      <organization>University of Tennessee</organization>
4203      <address><email>moore@cs.utk.edu</email></address>
4204    </author>
4205    <date month="November" year="1996"/>
4206  </front>
4207  <seriesInfo name="RFC" value="2047"/>
4208</reference>
4209
4210<reference anchor="RFC2068">
4211  <front>
4212    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4213    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
4214      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4215      <address><email>fielding@ics.uci.edu</email></address>
4216    </author>
4217    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4218      <organization>MIT Laboratory for Computer Science</organization>
4219      <address><email>jg@w3.org</email></address>
4220    </author>
4221    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
4222      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
4223      <address><email>mogul@wrl.dec.com</email></address>
4224    </author>
4225    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4226      <organization>MIT Laboratory for Computer Science</organization>
4227      <address><email>frystyk@w3.org</email></address>
4228    </author>
4229    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4230      <organization>MIT Laboratory for Computer Science</organization>
4231      <address><email>timbl@w3.org</email></address>
4232    </author>
4233    <date month="January" year="1997"/>
4234  </front>
4235  <seriesInfo name="RFC" value="2068"/>
4236</reference>
4237
4238<reference anchor="RFC2145">
4239  <front>
4240    <title abbrev="HTTP Version Numbers">Use and Interpretation of HTTP Version Numbers</title>
4241    <author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul">
4242      <organization>Western Research Laboratory</organization>
4243      <address><email>mogul@wrl.dec.com</email></address>
4244    </author>
4245    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4246      <organization>Department of Information and Computer Science</organization>
4247      <address><email>fielding@ics.uci.edu</email></address>
4248    </author>
4249    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4250      <organization>MIT Laboratory for Computer Science</organization>
4251      <address><email>jg@w3.org</email></address>
4252    </author>
4253    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4254      <organization>W3 Consortium</organization>
4255      <address><email>frystyk@w3.org</email></address>
4256    </author>
4257    <date month="May" year="1997"/>
4258  </front>
4259  <seriesInfo name="RFC" value="2145"/>
4260</reference>
4261
4262<reference anchor="RFC2616">
4263  <front>
4264    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4265    <author initials="R." surname="Fielding" fullname="R. Fielding">
4266      <organization>University of California, Irvine</organization>
4267      <address><email>fielding@ics.uci.edu</email></address>
4268    </author>
4269    <author initials="J." surname="Gettys" fullname="J. Gettys">
4270      <organization>W3C</organization>
4271      <address><email>jg@w3.org</email></address>
4272    </author>
4273    <author initials="J." surname="Mogul" fullname="J. Mogul">
4274      <organization>Compaq Computer Corporation</organization>
4275      <address><email>mogul@wrl.dec.com</email></address>
4276    </author>
4277    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
4278      <organization>MIT Laboratory for Computer Science</organization>
4279      <address><email>frystyk@w3.org</email></address>
4280    </author>
4281    <author initials="L." surname="Masinter" fullname="L. Masinter">
4282      <organization>Xerox Corporation</organization>
4283      <address><email>masinter@parc.xerox.com</email></address>
4284    </author>
4285    <author initials="P." surname="Leach" fullname="P. Leach">
4286      <organization>Microsoft Corporation</organization>
4287      <address><email>paulle@microsoft.com</email></address>
4288    </author>
4289    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
4290      <organization>W3C</organization>
4291      <address><email>timbl@w3.org</email></address>
4292    </author>
4293    <date month="June" year="1999"/>
4294  </front>
4295  <seriesInfo name="RFC" value="2616"/>
4296</reference>
4297
4298<reference anchor="RFC2817">
4299  <front>
4300    <title>Upgrading to TLS Within HTTP/1.1</title>
4301    <author initials="R." surname="Khare" fullname="R. Khare">
4302      <organization>4K Associates / UC Irvine</organization>
4303      <address><email>rohit@4K-associates.com</email></address>
4304    </author>
4305    <author initials="S." surname="Lawrence" fullname="S. Lawrence">
4306      <organization>Agranat Systems, Inc.</organization>
4307      <address><email>lawrence@agranat.com</email></address>
4308    </author>
4309    <date year="2000" month="May"/>
4310  </front>
4311  <seriesInfo name="RFC" value="2817"/>
4312</reference>
4313
4314<reference anchor="RFC2818">
4315  <front>
4316    <title>HTTP Over TLS</title>
4317    <author initials="E." surname="Rescorla" fullname="Eric Rescorla">
4318      <organization>RTFM, Inc.</organization>
4319      <address><email>ekr@rtfm.com</email></address>
4320    </author>
4321    <date year="2000" month="May"/>
4322  </front>
4323  <seriesInfo name="RFC" value="2818"/>
4324</reference>
4325
4326<reference anchor="RFC3040">
4327  <front>
4328    <title>Internet Web Replication and Caching Taxonomy</title>
4329    <author initials="I." surname="Cooper" fullname="I. Cooper">
4330      <organization>Equinix, Inc.</organization>
4331    </author>
4332    <author initials="I." surname="Melve" fullname="I. Melve">
4333      <organization>UNINETT</organization>
4334    </author>
4335    <author initials="G." surname="Tomlinson" fullname="G. Tomlinson">
4336      <organization>CacheFlow Inc.</organization>
4337    </author>
4338    <date year="2001" month="January"/>
4339  </front>
4340  <seriesInfo name="RFC" value="3040"/>
4341</reference>
4342
4343<reference anchor="BCP90">
4344  <front>
4345    <title>Registration Procedures for Message Header Fields</title>
4346    <author initials="G." surname="Klyne" fullname="G. Klyne">
4347      <organization>Nine by Nine</organization>
4348      <address><email>GK-IETF@ninebynine.org</email></address>
4349    </author>
4350    <author initials="M." surname="Nottingham" fullname="M. Nottingham">
4351      <organization>BEA Systems</organization>
4352      <address><email>mnot@pobox.com</email></address>
4353    </author>
4354    <author initials="J." surname="Mogul" fullname="J. Mogul">
4355      <organization>HP Labs</organization>
4356      <address><email>JeffMogul@acm.org</email></address>
4357    </author>
4358    <date year="2004" month="September"/>
4359  </front>
4360  <seriesInfo name="BCP" value="90"/>
4361  <seriesInfo name="RFC" value="3864"/>
4362</reference>
4363
4364<reference anchor="RFC4033">
4365  <front>
4366    <title>DNS Security Introduction and Requirements</title>
4367    <author initials="R." surname="Arends" fullname="R. Arends"/>
4368    <author initials="R." surname="Austein" fullname="R. Austein"/>
4369    <author initials="M." surname="Larson" fullname="M. Larson"/>
4370    <author initials="D." surname="Massey" fullname="D. Massey"/>
4371    <author initials="S." surname="Rose" fullname="S. Rose"/>
4372    <date year="2005" month="March"/>
4373  </front>
4374  <seriesInfo name="RFC" value="4033"/>
4375</reference>
4376
4377<reference anchor="BCP13">
4378  <front>
4379    <title>Media Type Specifications and Registration Procedures</title>
4380    <author initials="N." surname="Freed" fullname="Ned Freed">
4381      <organization>Oracle</organization>
4382      <address>
4383        <email>ned+ietf@mrochek.com</email>
4384      </address>
4385    </author>
4386    <author initials="J." surname="Klensin" fullname="John C. Klensin">
4387      <address>
4388        <email>john+ietf@jck.com</email>
4389      </address>
4390    </author>
4391    <author initials="T." surname="Hansen" fullname="Tony Hansen">
4392      <organization>AT&amp;T Laboratories</organization>
4393      <address>
4394        <email>tony+mtsuffix@maillennium.att.com</email>
4395      </address>
4396    </author>
4397    <date year="2013" month="January"/>
4398  </front>
4399  <seriesInfo name="BCP" value="13"/>
4400  <seriesInfo name="RFC" value="6838"/>
4401</reference>
4402
4403<reference anchor="BCP115">
4404  <front>
4405    <title>Guidelines and Registration Procedures for New URI Schemes</title>
4406    <author initials="T." surname="Hansen" fullname="T. Hansen">
4407      <organization>AT&amp;T Laboratories</organization>
4408      <address>
4409        <email>tony+urireg@maillennium.att.com</email>
4410      </address>
4411    </author>
4412    <author initials="T." surname="Hardie" fullname="T. Hardie">
4413      <organization>Qualcomm, Inc.</organization>
4414      <address>
4415        <email>hardie@qualcomm.com</email>
4416      </address>
4417    </author>
4418    <author initials="L." surname="Masinter" fullname="L. Masinter">
4419      <organization>Adobe Systems</organization>
4420      <address>
4421        <email>LMM@acm.org</email>
4422      </address>
4423    </author>
4424    <date year="2006" month="February"/>
4425  </front>
4426  <seriesInfo name="BCP" value="115"/>
4427  <seriesInfo name="RFC" value="4395"/>
4428</reference>
4429
4430<reference anchor="RFC4559">
4431  <front>
4432    <title>SPNEGO-based Kerberos and NTLM HTTP Authentication in Microsoft Windows</title>
4433    <author initials="K." surname="Jaganathan" fullname="K. Jaganathan"/>
4434    <author initials="L." surname="Zhu" fullname="L. Zhu"/>
4435    <author initials="J." surname="Brezak" fullname="J. Brezak"/>
4436    <date year="2006" month="June"/>
4437  </front>
4438  <seriesInfo name="RFC" value="4559"/>
4439</reference>
4440
4441<reference anchor="RFC5226">
4442  <front>
4443    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
4444    <author initials="T." surname="Narten" fullname="T. Narten">
4445      <organization>IBM</organization>
4446      <address><email>narten@us.ibm.com</email></address>
4447    </author>
4448    <author initials="H." surname="Alvestrand" fullname="H. Alvestrand">
4449      <organization>Google</organization>
4450      <address><email>Harald@Alvestrand.no</email></address>
4451    </author>
4452    <date year="2008" month="May"/>
4453  </front>
4454  <seriesInfo name="BCP" value="26"/>
4455  <seriesInfo name="RFC" value="5226"/>
4456</reference>
4457
4458<reference anchor="RFC5246">
4459   <front>
4460      <title>The Transport Layer Security (TLS) Protocol Version 1.2</title>
4461      <author initials="T." surname="Dierks" fullname="T. Dierks">
4462         <organization/>
4463      </author>
4464      <author initials="E." surname="Rescorla" fullname="E. Rescorla">
4465         <organization>RTFM, Inc.</organization>
4466      </author>
4467      <date year="2008" month="August"/>
4468   </front>
4469   <seriesInfo name="RFC" value="5246"/>
4470</reference>
4471
4472<reference anchor="RFC5322">
4473  <front>
4474    <title>Internet Message Format</title>
4475    <author initials="P." surname="Resnick" fullname="P. Resnick">
4476      <organization>Qualcomm Incorporated</organization>
4477    </author>
4478    <date year="2008" month="October"/>
4479  </front>
4480  <seriesInfo name="RFC" value="5322"/>
4481</reference>
4482
4483<reference anchor="RFC6265">
4484  <front>
4485    <title>HTTP State Management Mechanism</title>
4486    <author initials="A." surname="Barth" fullname="Adam Barth">
4487      <organization abbrev="U.C. Berkeley">
4488        University of California, Berkeley
4489      </organization>
4490      <address><email>abarth@eecs.berkeley.edu</email></address>
4491    </author>
4492    <date year="2011" month="April"/>
4493  </front>
4494  <seriesInfo name="RFC" value="6265"/>
4495</reference>
4496
4497<!--<reference anchor='BCP97'>
4498  <front>
4499    <title>Handling Normative References to Standards-Track Documents</title>
4500    <author initials='J.' surname='Klensin' fullname='J. Klensin'>
4501      <address>
4502        <email>klensin+ietf@jck.com</email>
4503      </address>
4504    </author>
4505    <author initials='S.' surname='Hartman' fullname='S. Hartman'>
4506      <organization>MIT</organization>
4507      <address>
4508        <email>hartmans-ietf@mit.edu</email>
4509      </address>
4510    </author>
4511    <date year='2007' month='June' />
4512  </front>
4513  <seriesInfo name='BCP' value='97' />
4514  <seriesInfo name='RFC' value='4897' />
4515</reference>-->
4516
4517<reference anchor="Kri2001" target="http://arxiv.org/abs/cs.SE/0105018">
4518  <front>
4519    <title>HTTP Cookies: Standards, Privacy, and Politics</title>
4520    <author initials="D." surname="Kristol" fullname="David M. Kristol"/>
4521    <date year="2001" month="November"/>
4522  </front>
4523  <seriesInfo name="ACM Transactions on Internet Technology" value="Vol. 1, #2"/>
4524</reference>
4525
4526</references>
4527
4528
4529<section title="HTTP Version History" anchor="compatibility">
4530<t>
4531   HTTP has been in use by the World-Wide Web global information initiative
4532   since 1990. The first version of HTTP, later referred to as HTTP/0.9,
4533   was a simple protocol for hypertext data transfer across the Internet
4534   with only a single request method (GET) and no metadata.
4535   HTTP/1.0, as defined by <xref target="RFC1945"/>, added a range of request
4536   methods and MIME-like messaging that could include metadata about the data
4537   transferred and modifiers on the request/response semantics. However,
4538   HTTP/1.0 did not sufficiently take into consideration the effects of
4539   hierarchical proxies, caching, the need for persistent connections, or
4540   name-based virtual hosts. The proliferation of incompletely-implemented
4541   applications calling themselves "HTTP/1.0" further necessitated a
4542   protocol version change in order for two communicating applications
4543   to determine each other's true capabilities.
4544</t>
4545<t>
4546   HTTP/1.1 remains compatible with HTTP/1.0 by including more stringent
4547   requirements that enable reliable implementations, adding only
4548   those new features that will either be safely ignored by an HTTP/1.0
4549   recipient or only sent when communicating with a party advertising
4550   conformance with HTTP/1.1.
4551</t>
4552<t>
4553   It is beyond the scope of a protocol specification to mandate
4554   conformance with previous versions. HTTP/1.1 was deliberately
4555   designed, however, to make supporting previous versions easy.
4556   We would expect a general-purpose HTTP/1.1 server to understand
4557   any valid request in the format of HTTP/1.0 and respond appropriately
4558   with an HTTP/1.1 message that only uses features understood (or
4559   safely ignored) by HTTP/1.0 clients.  Likewise, we would expect
4560   an HTTP/1.1 client to understand any valid HTTP/1.0 response.
4561</t>
4562<t>
4563   Since HTTP/0.9 did not support header fields in a request,
4564   there is no mechanism for it to support name-based virtual
4565   hosts (selection of resource by inspection of the <xref target="header.host" format="none">Host</xref> header
4566   field).  Any server that implements name-based virtual hosts
4567   ought to disable support for HTTP/0.9.  Most requests that
4568   appear to be HTTP/0.9 are, in fact, badly constructed HTTP/1.x
4569   requests wherein a buggy client failed to properly encode
4570   linear whitespace found in a URI reference and placed in
4571   the request-target.
4572</t>
4573
4574<section title="Changes from HTTP/1.0" anchor="changes.from.1.0">
4575<t>
4576   This section summarizes major differences between versions HTTP/1.0
4577   and HTTP/1.1.
4578</t>
4579
4580<section title="Multi-homed Web Servers" anchor="changes.to.simplify.multi-homed.web.servers.and.conserve.ip.addresses">
4581<t>
4582   The requirements that clients and servers support the <xref target="header.host" format="none">Host</xref>
4583   header field (<xref target="header.host"/>), report an error if it is
4584   missing from an HTTP/1.1 request, and accept absolute URIs (<xref target="request-target"/>)
4585   are among the most important changes defined by HTTP/1.1.
4586</t>
4587<t>
4588   Older HTTP/1.0 clients assumed a one-to-one relationship of IP
4589   addresses and servers; there was no other established mechanism for
4590   distinguishing the intended server of a request than the IP address
4591   to which that request was directed. The <xref target="header.host" format="none">Host</xref> header field was
4592   introduced during the development of HTTP/1.1 and, though it was
4593   quickly implemented by most HTTP/1.0 browsers, additional requirements
4594   were placed on all HTTP/1.1 requests in order to ensure complete
4595   adoption.  At the time of this writing, most HTTP-based services
4596   are dependent upon the Host header field for targeting requests.
4597</t>
4598</section>
4599
4600<section title="Keep-Alive Connections" anchor="compatibility.with.http.1.0.persistent.connections">
4601<t>
4602   In HTTP/1.0, each connection is established by the client prior to the
4603   request and closed by the server after sending the response. However, some
4604   implementations implement the explicitly negotiated ("Keep-Alive") version
4605   of persistent connections described in Section 19.7.1 of <xref target="RFC2068"/>.
4606</t>
4607<t>
4608   Some clients and servers might wish to be compatible with these previous
4609   approaches to persistent connections, by explicitly negotiating for them
4610   with a "Connection: keep-alive" request header field. However, some
4611   experimental implementations of HTTP/1.0 persistent connections are faulty;
4612   for example, if an HTTP/1.0 proxy server doesn't understand
4613   <xref target="header.connection" format="none">Connection</xref>, it will erroneously forward that header field
4614   to the next inbound server, which would result in a hung connection.
4615</t>
4616<t>
4617   One attempted solution was the introduction of a Proxy-Connection header
4618   field, targeted specifically at proxies. In practice, this was also
4619   unworkable, because proxies are often deployed in multiple layers, bringing
4620   about the same problem discussed above.
4621</t>
4622<t>
4623   As a result, clients are encouraged not to send the Proxy-Connection header
4624   field in any requests.
4625</t>
4626<t>
4627   Clients are also encouraged to consider the use of Connection: keep-alive
4628   in requests carefully; while they can enable persistent connections with
4629   HTTP/1.0 servers, clients using them need will need to monitor the
4630   connection for "hung" requests (which indicate that the client ought stop
4631   sending the header field), and this mechanism ought not be used by clients
4632   at all when a proxy is being used.
4633</t>
4634</section>
4635
4636<section title="Introduction of Transfer-Encoding" anchor="introduction.of.transfer-encoding">
4637<t>
4638   HTTP/1.1 introduces the <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field
4639   (<xref target="header.transfer-encoding"/>).
4640   Transfer codings need to be decoded prior to forwarding an HTTP message
4641   over a MIME-compliant protocol.
4642</t>
4643</section>
4644
4645</section>
4646
4647<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
4648<t>
4649  HTTP's approach to error handling has been explained.
4650  (<xref target="conformance"/>)
4651</t>
4652<t>
4653  The expectation to support HTTP/0.9 requests has been removed.
4654</t>
4655<t>
4656  The term "Effective Request URI" has been introduced.
4657  (<xref target="effective.request.uri"/>)
4658</t>
4659<t>
4660  HTTP messages can be (and often are) buffered by implementations; despite
4661  it sometimes being available as a stream, HTTP is fundamentally a
4662  message-oriented protocol.
4663  (<xref target="http.message"/>)
4664</t>
4665<t>
4666  Minimum supported sizes for various protocol elements have been
4667  suggested, to improve interoperability.
4668</t>
4669<t>
4670  Header fields that span multiple lines ("line folding") are deprecated.
4671  (<xref target="field.parsing"/>)
4672</t>
4673<t>
4674  The HTTP-version ABNF production has been clarified to be case-sensitive.
4675  Additionally, version numbers has been restricted to single digits, due
4676  to the fact that implementations are known to handle multi-digit version
4677  numbers incorrectly.
4678  (<xref target="http.version"/>)
4679</t>
4680<t>
4681  The HTTPS URI scheme is now defined by this specification; previously,
4682  it was done in  Section 2.4 of <xref target="RFC2818"/>.
4683  (<xref target="https.uri"/>)
4684</t>
4685<t>
4686  The HTTPS URI scheme implies end-to-end security.
4687  (<xref target="https.uri"/>)
4688</t>
4689<t>
4690  Userinfo (i.e., username and password) are now disallowed in HTTP and
4691  HTTPS URIs, because of security issues related to their transmission on the
4692  wire.
4693  (<xref target="http.uri"/>)
4694</t>
4695<t>
4696  Invalid whitespace around field-names is now required to be rejected,
4697  because accepting it represents a security vulnerability.
4698  (<xref target="header.fields"/>)
4699</t>
4700<t>
4701  The ABNF productions defining header fields now only list the field value.
4702  (<xref target="header.fields"/>)
4703</t>
4704<t>
4705  Rules about implicit linear whitespace between certain grammar productions
4706  have been removed; now whitespace is only allowed where specifically
4707  defined in the ABNF.
4708  (<xref target="whitespace"/>)
4709</t>
4710<t> 
4711  The NUL octet is no longer allowed in comment and quoted-string text, and
4712  handling of backslash-escaping in them has been clarified.
4713  (<xref target="field.components"/>)
4714</t> 
4715<t>
4716  The quoted-pair rule no longer allows escaping control characters other than
4717  HTAB.
4718  (<xref target="field.components"/>)
4719</t>
4720<t>
4721  Non-ASCII content in header fields and the reason phrase has been obsoleted
4722  and made opaque (the TEXT rule was removed).
4723  (<xref target="field.components"/>)
4724</t>
4725<t>
4726  Bogus "<xref target="header.content-length" format="none">Content-Length</xref>" header fields are now required to be
4727  handled as errors by recipients.
4728  (<xref target="header.content-length"/>)
4729</t>
4730<t>
4731  The "identity" transfer coding token has been removed.
4732  (Sections <xref format="counter" target="message.body"/> and
4733  <xref format="counter" target="transfer.codings"/>)
4734</t>
4735<t>
4736  The algorithm for determining the message body length has been clarified
4737  to indicate all of the special cases (e.g., driven by methods or status
4738  codes) that affect it, and that new protocol elements cannot define such
4739  special cases.
4740  (<xref target="message.body.length"/>)
4741</t>
4742<t>
4743  "multipart/byteranges" is no longer a way of determining message body length
4744  detection.
4745  (<xref target="message.body.length"/>)
4746</t>
4747<t>
4748  CONNECT is a new, special case in determining message body length.
4749  (<xref target="message.body.length"/>)
4750</t>
4751<t>
4752  Chunk length does not include the count of the octets in the
4753  chunk header and trailer.
4754  (<xref target="chunked.encoding"/>)
4755</t>
4756<t>
4757  Use of chunk extensions is deprecated, and line folding in them is
4758  disallowed.
4759  (<xref target="chunked.encoding"/>)
4760</t>
4761<t>
4762  The segment + query components of RFC3986 have been used to define the
4763  request-target, instead of abs_path from RFC 1808.
4764  (<xref target="request-target"/>)
4765</t>
4766<t>
4767  The asterisk form of the request-target is only allowed in the OPTIONS
4768  method.
4769  (<xref target="request-target"/>)
4770</t>
4771<t>
4772  Exactly when "close" connection options have to be sent has been clarified.
4773  (<xref target="header.connection"/>)
4774</t>
4775<t> 
4776  "hop-by-hop" header fields are required to appear in the Connection header
4777  field; just because they're defined as hop-by-hop in this specification
4778  doesn't exempt them.
4779  (<xref target="header.connection"/>)
4780</t>
4781<t>
4782  The limit of two connections per server has been removed.
4783  (<xref target="persistent.connections"/>)
4784</t>
4785<t>
4786  An idempotent sequence of requests is no longer required to be retried.
4787  (<xref target="persistent.connections"/>)
4788</t>
4789<t>
4790  The requirement to retry requests under certain circumstances when the
4791  server prematurely closes the connection has been removed.
4792  (<xref target="persistent.connections"/>)
4793</t>
4794<t>
4795  Some extraneous requirements about when servers are allowed to close
4796  connections prematurely have been removed.
4797  (<xref target="persistent.connections"/>)
4798</t>
4799<t>
4800  The semantics of the <xref target="header.upgrade" format="none">Upgrade</xref> header field is now defined in
4801  responses other than 101 (this was incorporated from <xref target="RFC2817"/>).
4802  (<xref target="header.upgrade"/>)
4803</t>
4804<t>
4805  Registration of Transfer Codings now requires IETF Review
4806  (<xref target="transfer.coding.registry"/>)
4807</t>
4808<t>
4809  The meaning of the "deflate" content coding has been clarified.
4810  (<xref target="deflate.coding"/>)
4811</t>
4812<t>
4813  This specification now defines the Upgrade Token Registry, previously
4814  defined in Section 7.2 of <xref target="RFC2817"/>.
4815  (<xref target="upgrade.token.registry"/>)
4816</t>
4817<t>
4818  Empty list elements in list productions (e.g., a list header containing
4819  ", ,") have been deprecated.
4820  (<xref target="abnf.extension"/>)
4821</t>
4822<t>
4823  Issues with the Keep-Alive and Proxy-Connection headers in requests
4824  are pointed out, with use of the latter being discouraged altogether.
4825  (<xref target="compatibility.with.http.1.0.persistent.connections"/>)
4826</t>
4827</section>
4828</section>
4829
4830<section title="ABNF list extension: #rule" anchor="abnf.extension">
4831<t>
4832  A #rule extension to the ABNF rules of <xref target="RFC5234"/> is used to
4833  improve readability in the definitions of some header field values.
4834</t>
4835<t>
4836  A construct "#" is defined, similar to "*", for defining comma-delimited
4837  lists of elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating
4838  at least &lt;n&gt; and at most &lt;m&gt; elements, each separated by a single
4839  comma (",") and optional whitespace (OWS).   
4840</t>
4841<figure><preamble>
4842  Thus,
4843</preamble><artwork type="example"><![CDATA[
4844  1#element => element *( OWS "," OWS element )
4845]]></artwork></figure>
4846<figure><preamble>
4847  and:
4848</preamble><artwork type="example"><![CDATA[
4849  #element => [ 1#element ]
4850]]></artwork></figure>
4851<figure><preamble>
4852  and for n &gt;= 1 and m &gt; 1:
4853</preamble><artwork type="example"><![CDATA[
4854  <n>#<m>element => element <n-1>*<m-1>( OWS "," OWS element )
4855]]></artwork></figure>
4856<t>
4857  For compatibility with legacy list rules, recipients SHOULD accept empty
4858  list elements. In other words, consumers would follow the list productions:
4859</t>
4860<figure><artwork type="example"><![CDATA[
4861  #element => [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
4862 
4863  1#element => *( "," OWS ) element *( OWS "," [ OWS element ] )
4864]]></artwork></figure>
4865<t>
4866  Note that empty elements do not contribute to the count of elements present,
4867  though.
4868</t>
4869<t>
4870  For example, given these ABNF productions:
4871</t>
4872<figure><artwork type="example"><![CDATA[
4873  example-list      = 1#example-list-elmt
4874  example-list-elmt = token ; see Section 3.2.6
4875]]></artwork></figure>
4876<t>
4877  Then these are valid values for example-list (not including the double
4878  quotes, which are present for delimitation only):
4879</t>
4880<figure><artwork type="example"><![CDATA[
4881  "foo,bar"
4882  "foo ,bar,"
4883  "foo , ,bar,charlie   "
4884]]></artwork></figure>
4885<t>
4886  But these values would be invalid, as at least one non-empty element is
4887  required:
4888</t>
4889<figure><artwork type="example"><![CDATA[
4890  ""
4891  ","
4892  ",   ,"
4893]]></artwork></figure>
4894<t>
4895  <xref target="collected.abnf"/> shows the collected ABNF, with the list rules
4896  expanded as explained above.
4897</t>
4898</section>
4899
4900
4901<section title="Collected ABNF" anchor="collected.abnf">
4902<figure>
4903<artwork type="abnf" name="p1-messaging.parsed-abnf"><![CDATA[
4904BWS = OWS
4905
4906Connection = *( "," OWS ) connection-option *( OWS "," [ OWS
4907 connection-option ] )
4908Content-Length = 1*DIGIT
4909
4910HTTP-message = start-line *( header-field CRLF ) CRLF [ message-body
4911 ]
4912HTTP-name = %x48.54.54.50 ; HTTP
4913HTTP-version = HTTP-name "/" DIGIT "." DIGIT
4914Host = uri-host [ ":" port ]
4915
4916OWS = *( SP / HTAB )
4917
4918RWS = 1*( SP / HTAB )
4919
4920TE = [ ( "," / t-codings ) *( OWS "," [ OWS t-codings ] ) ]
4921Trailer = *( "," OWS ) field-name *( OWS "," [ OWS field-name ] )
4922Transfer-Encoding = *( "," OWS ) transfer-coding *( OWS "," [ OWS
4923 transfer-coding ] )
4924
4925URI-reference = <URI-reference, defined in [RFC3986], Section 4.1>
4926Upgrade = *( "," OWS ) protocol *( OWS "," [ OWS protocol ] )
4927
4928Via = *( "," OWS ) ( received-protocol RWS received-by [ RWS comment
4929 ] ) *( OWS "," [ OWS ( received-protocol RWS received-by [ RWS
4930 comment ] ) ] )
4931
4932absolute-URI = <absolute-URI, defined in [RFC3986], Section 4.3>
4933absolute-form = absolute-URI
4934absolute-path = 1*( "/" segment )
4935asterisk-form = "*"
4936attribute = token
4937authority = <authority, defined in [RFC3986], Section 3.2>
4938authority-form = authority
4939
4940chunk = chunk-size [ chunk-ext ] CRLF chunk-data CRLF
4941chunk-data = 1*OCTET
4942chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
4943chunk-ext-name = token
4944chunk-ext-val = token / quoted-str-nf
4945chunk-size = 1*HEXDIG
4946chunked-body = *chunk last-chunk trailer-part CRLF
4947comment = "(" *( ctext / quoted-cpair / comment ) ")"
4948connection-option = token
4949ctext = HTAB / SP / %x21-27 ; '!'-'''
4950 / %x2A-5B ; '*'-'['
4951 / %x5D-7E ; ']'-'~'
4952 / obs-text
4953
4954field-content = *( HTAB / SP / VCHAR / obs-text )
4955field-name = token
4956field-value = *( field-content / obs-fold )
4957
4958header-field = field-name ":" OWS field-value BWS
4959http-URI = "http://" authority path-abempty [ "?" query ]
4960https-URI = "https://" authority path-abempty [ "?" query ]
4961
4962last-chunk = 1*"0" [ chunk-ext ] CRLF
4963
4964message-body = *OCTET
4965method = token
4966
4967obs-fold = CRLF ( SP / HTAB )
4968obs-text = %x80-FF
4969origin-form = absolute-path [ "?" query ]
4970
4971partial-URI = relative-part [ "?" query ]
4972path-abempty = <path-abempty, defined in [RFC3986], Section 3.3>
4973port = <port, defined in [RFC3986], Section 3.2.3>
4974protocol = protocol-name [ "/" protocol-version ]
4975protocol-name = token
4976protocol-version = token
4977pseudonym = token
4978
4979qdtext = HTAB / SP / "!" / %x23-5B ; '#'-'['
4980 / %x5D-7E ; ']'-'~'
4981 / obs-text
4982qdtext-nf = HTAB / SP / "!" / %x23-5B ; '#'-'['
4983 / %x5D-7E ; ']'-'~'
4984 / obs-text
4985query = <query, defined in [RFC3986], Section 3.4>
4986quoted-cpair = "\" ( HTAB / SP / VCHAR / obs-text )
4987quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
4988quoted-str-nf = DQUOTE *( qdtext-nf / quoted-pair ) DQUOTE
4989quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
4990
4991rank = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] )
4992reason-phrase = *( HTAB / SP / VCHAR / obs-text )
4993received-by = ( uri-host [ ":" port ] ) / pseudonym
4994received-protocol = [ protocol-name "/" ] protocol-version
4995relative-part = <relative-part, defined in [RFC3986], Section 4.2>
4996request-line = method SP request-target SP HTTP-version CRLF
4997request-target = origin-form / absolute-form / authority-form /
4998 asterisk-form
4999
5000segment = <segment, defined in [RFC3986], Section 3.3>
5001special = "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\" /
5002 DQUOTE / "/" / "[" / "]" / "?" / "=" / "{" / "}"
5003start-line = request-line / status-line
5004status-code = 3DIGIT
5005status-line = HTTP-version SP status-code SP reason-phrase CRLF
5006
5007t-codings = "trailers" / ( transfer-coding [ t-ranking ] )
5008t-ranking = OWS ";" OWS "q=" rank
5009tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
5010 "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
5011token = 1*tchar
5012trailer-part = *( header-field CRLF )
5013transfer-coding = "chunked" / "compress" / "deflate" / "gzip" /
5014 transfer-extension
5015transfer-extension = token *( OWS ";" OWS transfer-parameter )
5016transfer-parameter = attribute BWS "=" BWS value
5017
5018uri-host = <host, defined in [RFC3986], Section 3.2.2>
5019
5020value = word
5021
5022word = token / quoted-string
5023]]></artwork>
5024</figure>
5025</section>
5026
5027
5028<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
5029
5030<section title="Since RFC 2616">
5031<t>
5032  Changes up to the first Working Group Last Call draft are summarized
5033  in <eref target="http://trac.tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-21#appendix-D"/>.
5034</t>
5035</section>
5036
5037<section title="Since draft-ietf-httpbis-p1-messaging-21" anchor="changes.since.21">
5038<t>
5039  Closed issues:
5040  <list style="symbols">
5041    <t>
5042      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/128"/>:
5043      "Cite HTTPS URI scheme definition" (the spec now includes the HTTPs
5044      scheme definition and thus updates RFC 2818)
5045    </t>
5046    <t>
5047      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/389"/>:
5048      "mention of 'proxies' in section about caches"
5049    </t>
5050    <t>
5051      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/390"/>:
5052      "use of ABNF terms from RFC 3986"
5053    </t>
5054    <t>
5055      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/392"/>:
5056      "editorial improvements to message length definition"
5057    </t>
5058    <t>
5059      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/395"/>:
5060      "Connection header field MUST vs SHOULD"
5061    </t>
5062    <t>
5063      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/396"/>:
5064      "editorial improvements to persistent connections section"
5065    </t>
5066    <t>
5067      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/397"/>:
5068      "URI normalization vs empty path"
5069    </t>
5070    <t>
5071      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/408"/>:
5072      "p1 feedback"
5073    </t>
5074    <t>
5075      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/409"/>:
5076      "is parsing OBS-FOLD mandatory?"
5077    </t>
5078    <t>
5079      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/410"/>:
5080      "HTTPS and Shared Caching"
5081    </t>
5082    <t>
5083      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/411"/>:
5084      "Requirements for recipients of ws between start-line and first header field"
5085    </t>
5086    <t>
5087      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/412"/>:
5088      "SP and HT when being tolerant"
5089    </t>
5090    <t>
5091      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/414"/>:
5092      "Message Parsing Strictness"
5093    </t>
5094    <t>
5095      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/415"/>:
5096      "'Render'"
5097    </t>
5098    <t>
5099      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/418"/>:
5100      "No-Transform"
5101    </t>
5102    <t>
5103      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/419"/>:
5104      "p2 editorial feedback"
5105    </t>
5106    <t>
5107      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/420"/>:
5108      "Content-Length SHOULD be sent"
5109    </t>
5110    <t>
5111      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/431"/>:
5112      "origin-form does not allow path starting with "//""
5113    </t>
5114    <t>
5115      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/433"/>:
5116      "ambiguity in part 1 example"
5117    </t>
5118  </list>
5119</t>
5120</section>
5121
5122<!--<section title="Since draft-ietf-httpbis-p1-messaging-22" anchor="changes.since.22">
5123<t>
5124  None yet.
5125</t>
5126</section>-->
5127</section>
5128
5129</back>
5130</rfc>
Note: See TracBrowser for help on using the repository browser.