source: draft-ietf-httpbis/26/draft-ietf-httpbis-p1-messaging-26.xml @ 2616

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

prepare publication of -26

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 231.3 KB
1<?xml version="1.0" encoding="UTF-8"?>
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.
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-26">
24  <title abbrev="HTTP/1.1 Message Syntax and Routing">Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
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></email>
37      <uri></uri>
38    </address>
39  </author>
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></email>
50      <uri></uri>
51    </address>
52  </author>
54  <date month="February" year="2014" day="6"/>
56  <area>Applications</area>
57  <workgroup>HTTPbis Working Group</workgroup>
61   The Hypertext Transfer Protocol (HTTP) is a stateless application-level
62   protocol for distributed, collaborative, hypertext information systems.
63   This document provides an overview of HTTP architecture and its associated
64   terminology, defines the "http" and "https" Uniform Resource Identifier
65   (URI) schemes, defines the HTTP/1.1 message syntax and parsing
66   requirements, and describes related security concerns for implementations.
70<note title="Editorial Note (To be removed by RFC Editor)">
71  <t>
72    Discussion of this draft takes place on the HTTPBIS working group
73    mailing list (, which is archived at
74    <eref target=""/>.
75  </t>
76  <t>
77    The current issues list is at
78    <eref target=""/> and related
79    documents (including fancy diffs) can be found at
80    <eref target=""/>.
81  </t>
82  <t>
83    The changes in this draft are summarized in <xref target="changes.since.25"/>.
84  </t>
88<section title="Introduction" anchor="introduction">
90   The Hypertext Transfer Protocol (HTTP) is a stateless application-level
91   request/response protocol that uses extensible semantics and
92   self-descriptive message payloads for flexible interaction with
93   network-based hypertext information systems. This document is the first in
94   a series of documents that collectively form the HTTP/1.1 specification:
95   <list style="empty">
96    <t>RFC xxx1: Message Syntax and Routing</t>
97    <t>RFC xxx2: Semantics and Content</t>
98    <t>RFC xxx3: Conditional Requests</t>
99    <t>RFC xxx4: Range Requests</t>
100    <t>RFC xxx5: Caching</t>
101    <t>RFC xxx6: Authentication</t>
102   </list>
105   This HTTP/1.1 specification obsoletes
106   RFC 2616 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.
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.
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.
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.
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.
156<section title="Requirement Notation" anchor="intro.requirements">
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"/>.
163   Conformance criteria and considerations regarding error handling
164   are defined in <xref target="conformance"/>.
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"/>
182   This specification uses the Augmented Backus-Naur Form (ABNF) notation of
183   <xref target="RFC5234"/> with a list extension, defined in
184   <xref target="abnf.extension"/>, that allows for compact definition of
185   comma-separated lists using a '#' operator (similar to how the '*' operator
186   indicates repetition).
187   <xref target="collected.abnf"/> shows the collected grammar with all list
188   operators expanded to standard ABNF notation.
190<t anchor="core.rules">
203   The following core rules are included by
204   reference, as defined in <xref target="RFC5234"/>, Appendix B.1:
205   ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
206   DIGIT (decimal 0-9), DQUOTE (double quote),
207   HEXDIG (hexadecimal 0-9/A-F/a-f), HTAB (horizontal tab), LF (line feed),
208   OCTET (any 8-bit sequence of data), SP (space), and
209   VCHAR (any visible <xref target="USASCII"/> character).
212   As a convention, ABNF rule names prefixed with "obs-" denote
213   "obsolete" grammar rules that appear for historical reasons.
218<section title="Architecture" anchor="architecture">
220   HTTP was created for the World Wide Web (WWW) architecture
221   and has evolved over time to support the scalability needs of a worldwide
222   hypertext system. Much of that architecture is reflected in the terminology
223   and syntax productions used to define HTTP.
226<section title="Client/Server Messaging" anchor="operation">
227<iref primary="true" item="client"/>
228<iref primary="true" item="server"/>
229<iref primary="true" item="connection"/>
231   HTTP is a stateless request/response protocol that operates by exchanging
232   messages (<xref target="http.message"/>) across a reliable
233   transport or session-layer
234   "connection" (<xref target=""/>).
235   An HTTP "client" is a program that establishes a connection
236   to a server for the purpose of sending one or more HTTP requests.
237   An HTTP "server" is a program that accepts connections
238   in order to service HTTP requests by sending HTTP responses.
240<iref primary="true" item="user agent"/>
241<iref primary="true" item="origin server"/>
242<iref primary="true" item="browser"/>
243<iref primary="true" item="spider"/>
244<iref primary="true" item="sender"/>
245<iref primary="true" item="recipient"/>
247   The terms client and server refer only to the roles that
248   these programs perform for a particular connection.  The same program
249   might act as a client on some connections and a server on others.
250   The term "user agent" refers to any of the various
251   client programs that initiate a request, including (but not limited to)
252   browsers, spiders (web-based robots), command-line tools, custom
253   applications, and mobile apps.
254   The term "origin server" refers to the program that can
255   originate authoritative responses for a given target resource.
256   The terms "sender" and "recipient" refer to
257   any implementation that sends or receives a given message, respectively.
260   HTTP relies upon the Uniform Resource Identifier (URI)
261   standard <xref target="RFC3986"/> to indicate the target resource
262   (<xref target="target-resource"/>) and relationships between resources.
263   Messages are passed in a format similar to that used by Internet mail
264   <xref target="RFC5322"/> and the Multipurpose Internet Mail Extensions
265   (MIME) <xref target="RFC2045"/> (see Appendix A of <xref target="Part2"/> for the differences
266   between HTTP and MIME messages).
269   Most HTTP communication consists of a retrieval request (GET) for
270   a representation of some resource identified by a URI.  In the
271   simplest case, this might be accomplished via a single bidirectional
272   connection (===) between the user agent (UA) and the origin server (O).
274<figure><artwork type="drawing"><![CDATA[
275         request   >
276    UA ======================================= O
277                                <   response
279<iref primary="true" item="message"/>
280<iref primary="true" item="request"/>
281<iref primary="true" item="response"/>
283   A client sends an HTTP request to a server in the form of a request
284   message, beginning with a request-line that includes a method, URI, and
285   protocol version (<xref target="request.line"/>),
286   followed by header fields containing
287   request modifiers, client information, and representation metadata
288   (<xref target="header.fields"/>),
289   an empty line to indicate the end of the header section, and finally
290   a message body containing the payload body (if any,
291   <xref target="message.body"/>).
294   A server responds to a client's request by sending one or more HTTP
295   response
296   messages, each beginning with a status line that
297   includes the protocol version, a success or error code, and textual
298   reason phrase (<xref target="status.line"/>),
299   possibly followed by header fields containing server
300   information, resource metadata, and representation metadata
301   (<xref target="header.fields"/>),
302   an empty line to indicate the end of the header section, and finally
303   a message body containing the payload body (if any,
304   <xref target="message.body"/>).
307   A connection might be used for multiple request/response exchanges,
308   as defined in <xref target="persistent.connections"/>.
311   The following example illustrates a typical message exchange for a
312   GET request (Section 4.3.1 of <xref target="Part2"/>) on the URI "":
315Client request:
316</preamble><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
317  GET /hello.txt HTTP/1.1
318  User-Agent: curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
319  Host:
320  Accept-Language: en, mi
322  ]]></artwork></figure>
324Server response:
325</preamble><artwork type="message/http; msgtype=&#34;response&#34;"><![CDATA[
326  HTTP/1.1 200 OK
327  Date: Mon, 27 Jul 2009 12:28:53 GMT
328  Server: Apache
329  Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
330  ETag: "34aa387-d-1568eb00"
331  Accept-Ranges: bytes
332  Content-Length: 51
333  Vary: Accept-Encoding
334  Content-Type: text/plain
336  Hello World! My payload includes a trailing CRLF.
337  ]]></artwork>
341<section title="Implementation Diversity" anchor="implementation-diversity">
343   When considering the design of HTTP, it is easy to fall into a trap of
344   thinking that all user agents are general-purpose browsers and all origin
345   servers are large public websites. That is not the case in practice.
346   Common HTTP user agents include household appliances, stereos, scales,
347   firmware update scripts, command-line programs, mobile apps,
348   and communication devices in a multitude of shapes and sizes.  Likewise,
349   common HTTP origin servers include home automation units, configurable
350   networking components, office machines, autonomous robots, news feeds,
351   traffic cameras, ad selectors, and video delivery platforms.
354   The term "user agent" does not imply that there is a human user directly
355   interacting with the software agent at the time of a request. In many
356   cases, a user agent is installed or configured to run in the background
357   and save its results for later inspection (or save only a subset of those
358   results that might be interesting or erroneous). Spiders, for example, are
359   typically given a start URI and configured to follow certain behavior while
360   crawling the Web as a hypertext graph.
363   The implementation diversity of HTTP means that not all user agents can
364   make interactive suggestions to their user or provide adequate warning for
365   security or privacy concerns. In the few cases where this
366   specification requires reporting of errors to the user, it is acceptable
367   for such reporting to only be observable in an error console or log file.
368   Likewise, requirements that an automated action be confirmed by the user
369   before proceeding might be met via advance configuration choices,
370   run-time options, or simple avoidance of the unsafe action; confirmation
371   does not imply any specific user interface or interruption of normal
372   processing if the user has already made that choice.
376<section title="Intermediaries" anchor="intermediaries">
377<iref primary="true" item="intermediary"/>
379   HTTP enables the use of intermediaries to satisfy requests through
380   a chain of connections.  There are three common forms of HTTP
381   intermediary: proxy, gateway, and tunnel.  In some cases,
382   a single intermediary might act as an origin server, proxy, gateway,
383   or tunnel, switching behavior based on the nature of each request.
385<figure><artwork type="drawing"><![CDATA[
386         >             >             >             >
387    UA =========== A =========== B =========== C =========== O
388               <             <             <             <
391   The figure above shows three intermediaries (A, B, and C) between the
392   user agent and origin server. A request or response message that
393   travels the whole chain will pass through four separate connections.
394   Some HTTP communication options
395   might apply only to the connection with the nearest, non-tunnel
396   neighbor, only to the end-points of the chain, or to all connections
397   along the chain. Although the diagram is linear, each participant might
398   be engaged in multiple, simultaneous communications. For example, B
399   might be receiving requests from many clients other than A, and/or
400   forwarding requests to servers other than C, at the same time that it
401   is handling A's request. Likewise, later requests might be sent through a
402   different path of connections, often based on dynamic configuration for
403   load balancing.   
406<iref primary="true" item="upstream"/><iref primary="true" item="downstream"/>
407<iref primary="true" item="inbound"/><iref primary="true" item="outbound"/>
408   The terms "upstream" and "downstream" are
409   used to describe directional requirements in relation to the message flow:
410   all messages flow from upstream to downstream.
411   The terms inbound and outbound are used to describe directional
412   requirements in relation to the request route:
413   "inbound" means toward the origin server and
414   "outbound" means toward the user agent.
416<t><iref primary="true" item="proxy"/>
417   A "proxy" is a message forwarding agent that is selected by the
418   client, usually via local configuration rules, to receive requests
419   for some type(s) of absolute URI and attempt to satisfy those
420   requests via translation through the HTTP interface.  Some translations
421   are minimal, such as for proxy requests for "http" URIs, whereas
422   other requests might require translation to and from entirely different
423   application-level protocols. Proxies are often used to group an
424   organization's HTTP requests through a common intermediary for the
425   sake of security, annotation services, or shared caching. Some proxies
426   are designed to apply transformations to selected messages or payloads
427   while they are being forwarded, as described in
428   <xref target="message.transformations"/>.
430<t><iref primary="true" item="gateway"/><iref primary="true" item="reverse proxy"/>
431<iref primary="true" item="accelerator"/>
432   A "gateway" (a.k.a., "reverse proxy") is an
433   intermediary that acts as an origin server for the outbound connection, but
434   translates received requests and forwards them inbound to another server or
435   servers. Gateways are often used to encapsulate legacy or untrusted
436   information services, to improve server performance through
437   "accelerator" caching, and to enable partitioning or load
438   balancing of HTTP services across multiple machines.
441   All HTTP requirements applicable to an origin server
442   also apply to the outbound communication of a gateway.
443   A gateway communicates with inbound servers using any protocol that
444   it desires, including private extensions to HTTP that are outside
445   the scope of this specification.  However, an HTTP-to-HTTP gateway
446   that wishes to interoperate with third-party HTTP servers ought to conform
447   to user agent requirements on the gateway's inbound connection.
449<t><iref primary="true" item="tunnel"/>
450   A "tunnel" acts as a blind relay between two connections
451   without changing the messages. Once active, a tunnel is not
452   considered a party to the HTTP communication, though the tunnel might
453   have been initiated by an HTTP request. A tunnel ceases to exist when
454   both ends of the relayed connection are closed. Tunnels are used to
455   extend a virtual connection through an intermediary, such as when
456   Transport Layer Security (TLS, <xref target="RFC5246"/>) is used to
457   establish confidential communication through a shared firewall proxy.
460   The above categories for intermediary only consider those acting as
461   participants in the HTTP communication.  There are also intermediaries
462   that can act on lower layers of the network protocol stack, filtering or
463   redirecting HTTP traffic without the knowledge or permission of message
464   senders. Network intermediaries are indistinguishable (at a protocol level)
465   from a man-in-the-middle attack, often introducing security flaws or
466   interoperability problems due to mistakenly violating HTTP semantics.
468<t><iref primary="true" item="interception proxy"/>
469<iref primary="true" item="transparent proxy"/>
470<iref primary="true" item="captive portal"/>
471   For example, an
472   "interception proxy" <xref target="RFC3040"/> (also commonly
473   known as a "transparent proxy" <xref target="RFC1919"/> or
474   "captive portal")
475   differs from an HTTP proxy because it is not selected by the client.
476   Instead, an interception proxy filters or redirects outgoing TCP port 80
477   packets (and occasionally other common port traffic).
478   Interception proxies are commonly found on public network access points,
479   as a means of enforcing account subscription prior to allowing use of
480   non-local Internet services, and within corporate firewalls to enforce
481   network usage policies.
484   HTTP is defined as a stateless protocol, meaning that each request message
485   can be understood in isolation.  Many implementations depend on HTTP's
486   stateless design in order to reuse proxied connections or dynamically
487   load-balance requests across multiple servers.  Hence, a server MUST NOT
488   assume that two requests on the same connection are from the same user
489   agent unless the connection is secured and specific to that agent.
490   Some non-standard HTTP extensions (e.g., <xref target="RFC4559"/>) have
491   been known to violate this requirement, resulting in security and
492   interoperability problems.
496<section title="Caches" anchor="caches">
497<iref primary="true" item="cache"/>
499   A "cache" is a local store of previous response messages and the
500   subsystem that controls its message storage, retrieval, and deletion.
501   A cache stores cacheable responses in order to reduce the response
502   time and network bandwidth consumption on future, equivalent
503   requests. Any client or server MAY employ a cache, though a cache
504   cannot be used by a server while it is acting as a tunnel.
507   The effect of a cache is that the request/response chain is shortened
508   if one of the participants along the chain has a cached response
509   applicable to that request. The following illustrates the resulting
510   chain if B has a cached copy of an earlier response from O (via C)
511   for a request that has not been cached by UA or A.
513<figure><artwork type="drawing"><![CDATA[
514            >             >
515       UA =========== A =========== B - - - - - - C - - - - - - O
516                  <             <
518<t><iref primary="true" item="cacheable"/>
519   A response is "cacheable" if a cache is allowed to store a copy of
520   the response message for use in answering subsequent requests.
521   Even when a response is cacheable, there might be additional
522   constraints placed by the client or by the origin server on when
523   that cached response can be used for a particular request. HTTP
524   requirements for cache behavior and cacheable responses are
525   defined in Section 2 of <xref target="Part6"/>. 
528   There are a wide variety of architectures and configurations
529   of caches deployed across the World Wide Web and
530   inside large organizations. These include national hierarchies
531   of proxy caches to save transoceanic bandwidth, collaborative systems that
532   broadcast or multicast cache entries, archives of pre-fetched cache
533   entries for use in off-line or high-latency environments, and so on.
537<section title="Conformance and Error Handling" anchor="conformance">
539   This specification targets conformance criteria according to the role of
540   a participant in HTTP communication.  Hence, HTTP requirements are placed
541   on senders, recipients, clients, servers, user agents, intermediaries,
542   origin servers, proxies, gateways, or caches, depending on what behavior
543   is being constrained by the requirement. Additional (social) requirements
544   are placed on implementations, resource owners, and protocol element
545   registrations when they apply beyond the scope of a single communication.
548   The verb "generate" is used instead of "send" where a requirement
549   differentiates between creating a protocol element and merely forwarding a
550   received element downstream.
553   An implementation is considered conformant if it complies with all of the
554   requirements associated with the roles it partakes in HTTP.
557   Conformance includes both the syntax and semantics of protocol
558   elements. A sender MUST NOT generate protocol elements that convey a
559   meaning that is known by that sender to be false. A sender MUST NOT
560   generate protocol elements that do not match the grammar defined by the
561   corresponding ABNF rules. Within a given message, a sender MUST NOT
562   generate protocol elements or syntax alternatives that are only allowed to
563   be generated by participants in other roles (i.e., a role that the sender
564   does not have for that message).
567   When a received protocol element is parsed, the recipient MUST be able to
568   parse any value of reasonable length that is applicable to the recipient's
569   role and matches the grammar defined by the corresponding ABNF rules.
570   Note, however, that some received protocol elements might not be parsed.
571   For example, an intermediary forwarding a message might parse a
572   header-field into generic field-name and field-value components, but then
573   forward the header field without further parsing inside the field-value.
576   HTTP does not have specific length limitations for many of its protocol
577   elements because the lengths that might be appropriate will vary widely,
578   depending on the deployment context and purpose of the implementation.
579   Hence, interoperability between senders and recipients depends on shared
580   expectations regarding what is a reasonable length for each protocol
581   element. Furthermore, what is commonly understood to be a reasonable length
582   for some protocol elements has changed over the course of the past two
583   decades of HTTP use, and is expected to continue changing in the future.
586   At a minimum, a recipient MUST be able to parse and process protocol
587   element lengths that are at least as long as the values that it generates
588   for those same protocol elements in other messages. For example, an origin
589   server that publishes very long URI references to its own resources needs
590   to be able to parse and process those same references when received as a
591   request target.
594   A recipient MUST interpret a received protocol element according to the
595   semantics defined for it by this specification, including extensions to
596   this specification, unless the recipient has determined (through experience
597   or configuration) that the sender incorrectly implements what is implied by
598   those semantics.
599   For example, an origin server might disregard the contents of a received
600   Accept-Encoding header field if inspection of the
601   User-Agent header field indicates a specific implementation
602   version that is known to fail on receipt of certain content codings.
605   Unless noted otherwise, a recipient MAY attempt to recover a usable
606   protocol element from an invalid construct.  HTTP does not define
607   specific error handling mechanisms except when they have a direct impact
608   on security, since different applications of the protocol require
609   different error handling strategies.  For example, a Web browser might
610   wish to transparently recover from a response where the
611   Location header field doesn't parse according to the ABNF,
612   whereas a systems control client might consider any form of error recovery
613   to be dangerous.
617<section title="Protocol Versioning" anchor="http.version">
621   HTTP uses a "&lt;major&gt;.&lt;minor&gt;" numbering scheme to indicate
622   versions of the protocol. This specification defines version "1.1".
623   The protocol version as a whole indicates the sender's conformance
624   with the set of requirements laid out in that version's corresponding
625   specification of HTTP.
628   The version of an HTTP message is indicated by an HTTP-version field
629   in the first line of the message. HTTP-version is case-sensitive.
631<figure><iref primary="true" item="Grammar" subitem="HTTP-version"/><iref primary="true" item="Grammar" subitem="HTTP-name"/><artwork type="abnf2616"><![CDATA[
632  HTTP-version  = HTTP-name "/" DIGIT "." DIGIT
633  HTTP-name     = %x48.54.54.50 ; "HTTP", case-sensitive
636   The HTTP version number consists of two decimal digits separated by a "."
637   (period or decimal point).  The first digit ("major version") indicates the
638   HTTP messaging syntax, whereas the second digit ("minor version") indicates
639   the highest minor version within that major version to which the sender is
640   conformant and able to understand for future communication.  The minor
641   version advertises the sender's communication capabilities even when the
642   sender is only using a backwards-compatible subset of the protocol,
643   thereby letting the recipient know that more advanced features can
644   be used in response (by servers) or in future requests (by clients).
647   When an HTTP/1.1 message is sent to an HTTP/1.0 recipient
648   <xref target="RFC1945"/> or a recipient whose version is unknown,
649   the HTTP/1.1 message is constructed such that it can be interpreted
650   as a valid HTTP/1.0 message if all of the newer features are ignored.
651   This specification places recipient-version requirements on some
652   new features so that a conformant sender will only use compatible
653   features until it has determined, through configuration or the
654   receipt of a message, that the recipient supports HTTP/1.1.
657   The interpretation of a header field does not change between minor
658   versions of the same major HTTP version, though the default
659   behavior of a recipient in the absence of such a field can change.
660   Unless specified otherwise, header fields defined in HTTP/1.1 are
661   defined for all versions of HTTP/1.x.  In particular, the <xref target="" format="none">Host</xref>
662   and <xref target="header.connection" format="none">Connection</xref> header fields ought to be implemented by all
663   HTTP/1.x implementations whether or not they advertise conformance with
664   HTTP/1.1.
667   New header fields can be introduced without changing the protocol version
668   if their defined semantics allow them to be safely ignored by recipients
669   that do not recognize them. Header field extensibility is discussed in
670   <xref target="field.extensibility"/>.
673   Intermediaries that process HTTP messages (i.e., all intermediaries
674   other than those acting as tunnels) MUST send their own HTTP-version
675   in forwarded messages.  In other words, they are not allowed to blindly
676   forward the first line of an HTTP message without ensuring that the
677   protocol version in that message matches a version to which that
678   intermediary is conformant for both the receiving and
679   sending of messages.  Forwarding an HTTP message without rewriting
680   the HTTP-version might result in communication errors when downstream
681   recipients use the message sender's version to determine what features
682   are safe to use for later communication with that sender.
685   A client SHOULD send a request version equal to the highest
686   version to which the client is conformant and
687   whose major version is no higher than the highest version supported
688   by the server, if this is known.  A client MUST NOT send a
689   version to which it is not conformant.
692   A client MAY send a lower request version if it is known that
693   the server incorrectly implements the HTTP specification, but only
694   after the client has attempted at least one normal request and determined
695   from the response status code or header fields (e.g., Server) that
696   the server improperly handles higher request versions.
699   A server SHOULD send a response version equal to the highest version to
700   which the server is conformant that has a major version less than or equal
701   to the one received in the request.
702   A server MUST NOT send a version to which it is not conformant.
703   A server can send a 505 (HTTP Version Not Supported)
704   response if it wishes, for any reason, to refuse service of the client's
705   major protocol version.
708   A server MAY send an HTTP/1.0 response to a request
709   if it is known or suspected that the client incorrectly implements the
710   HTTP specification and is incapable of correctly processing later
711   version responses, such as when a client fails to parse the version
712   number correctly or when an intermediary is known to blindly forward
713   the HTTP-version even when it doesn't conform to the given minor
714   version of the protocol. Such protocol downgrades SHOULD NOT be
715   performed unless triggered by specific client attributes, such as when
716   one or more of the request header fields (e.g., User-Agent)
717   uniquely match the values sent by a client known to be in error.
720   The intention of HTTP's versioning design is that the major number
721   will only be incremented if an incompatible message syntax is
722   introduced, and that the minor number will only be incremented when
723   changes made to the protocol have the effect of adding to the message
724   semantics or implying additional capabilities of the sender.  However,
725   the minor version was not incremented for the changes introduced between
726   <xref target="RFC2068"/> and <xref target="RFC2616"/>, and this revision
727   has specifically avoided any such changes to the protocol.
730   When an HTTP message is received with a major version number that the
731   recipient implements, but a higher minor version number than what the
732   recipient implements, the recipient SHOULD process the message as if it
733   were in the highest minor version within that major version to which the
734   recipient is conformant. A recipient can assume that a message with a
735   higher minor version, when sent to a recipient that has not yet indicated
736   support for that higher version, is sufficiently backwards-compatible to be
737   safely processed by any implementation of the same major version.
741<section title="Uniform Resource Identifiers" anchor="uri">
742<iref primary="true" item="resource"/>
744   Uniform Resource Identifiers (URIs) <xref target="RFC3986"/> are used
745   throughout HTTP as the means for identifying resources (Section 2 of <xref target="Part2"/>).
746   URI references are used to target requests, indicate redirects, and define
747   relationships.
764   The definitions of "URI-reference",
765   "absolute-URI", "relative-part", "scheme", "authority", "port", "host",
766   "path-abempty", "segment", "query", and "fragment" are adopted from the
767   URI generic syntax.
768   An "absolute-path" rule is defined for protocol elements that can contain a
769   non-empty path component. (This rule differs slightly from RFC 3986's
770   path-abempty rule, which allows for an empty path to be used in references,
771   and path-absolute rule, which does not allow paths that begin with "//".)
772   A "partial-URI" rule is defined for protocol elements
773   that can contain a relative URI but not a fragment component.
775<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="scheme"/><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="fragment"/><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[
776  URI-reference = <URI-reference, defined in [RFC3986], Section 4.1>
777  absolute-URI  = <absolute-URI, defined in [RFC3986], Section 4.3>
778  relative-part = <relative-part, defined in [RFC3986], Section 4.2>
779  scheme        = <scheme, defined in [RFC3986], Section 3.1>
780  authority     = <authority, defined in [RFC3986], Section 3.2>
781  uri-host      = <host, defined in [RFC3986], Section 3.2.2>
782  port          = <port, defined in [RFC3986], Section 3.2.3>
783  path-abempty  = <path-abempty, defined in [RFC3986], Section 3.3>
784  segment       = <segment, defined in [RFC3986], Section 3.3>
785  query         = <query, defined in [RFC3986], Section 3.4>
786  fragment      = <fragment, defined in [RFC3986], Section 3.5>
788  absolute-path = 1*( "/" segment )
789  partial-URI   = relative-part [ "?" query ]
792   Each protocol element in HTTP that allows a URI reference will indicate
793   in its ABNF production whether the element allows any form of reference
794   (URI-reference), only a URI in absolute form (absolute-URI), only the
795   path and optional query components, or some combination of the above.
796   Unless otherwise indicated, URI references are parsed
797   relative to the effective request URI
798   (<xref target="effective.request.uri"/>).
801<section title="http URI scheme" anchor="http.uri">
803  <iref item="http URI scheme" primary="true"/>
804  <iref item="URI scheme" subitem="http" primary="true"/>
806   The "http" URI scheme is hereby defined for the purpose of minting
807   identifiers according to their association with the hierarchical
808   namespace governed by a potential HTTP origin server listening for
809   TCP (<xref target="RFC0793"/>) connections on a given port.
811<figure><iref primary="true" item="Grammar" subitem="http-URI"><!--terminal production--></iref><artwork type="abnf2616"><![CDATA[
812  http-URI = "http:" "//" authority path-abempty [ "?" query ]
813             [ "#" fragment ]
816   The origin server for an "http" URI is identified by the
817   <xref target="uri" format="none">authority</xref> component, which includes a host identifier
818   and optional TCP port (<xref target="RFC3986"/>, Section 3.2.2).
819   The hierarchical path component and optional query component serve as an
820   identifier for a potential target resource within that origin server's name
821   space. The optional fragment component allows for indirect identification
822   of a secondary resource, independent of the URI scheme, as defined in
823   Section 3.5 of <xref target="RFC3986"/>.
826   A sender MUST NOT generate an "http" URI with an empty host identifier.
827   A recipient that processes such a URI reference MUST reject it as invalid.
830   If the host identifier is provided as an IP address, the origin server is
831   the listener (if any) on the indicated TCP port at that IP address.
832   If host is a registered name, the registered name is an indirect identifier
833   for use with a name resolution service, such as DNS, to find an address for
834   that origin server.
835   If the port subcomponent is empty or not given, TCP port 80 (the
836   reserved port for WWW services) is the default.
839   Note that the presence of a URI with a given authority component does not
840   imply that there is always an HTTP server listening for connections on
841   that host and port. Anyone can mint a URI. What the authority component
842   determines is who has the right to respond authoritatively to requests that
843   target the identified resource. The delegated nature of registered names
844   and IP addresses creates a federated namespace, based on control over the
845   indicated host and port, whether or not an HTTP server is present.
846   See <xref target="establishing.authority"/> for security considerations
847   related to establishing authority.
850   When an "http" URI is used within a context that calls for access to the
851   indicated resource, a client MAY attempt access by resolving
852   the host to an IP address, establishing a TCP connection to that address
853   on the indicated port, and sending an HTTP request message
854   (<xref target="http.message"/>) containing the URI's identifying data
855   (<xref target="message.routing"/>) to the server.
856   If the server responds to that request with a non-interim HTTP response
857   message, as described in Section 6 of <xref target="Part2"/>, then that response
858   is considered an authoritative answer to the client's request.
861   Although HTTP is independent of the transport protocol, the "http"
862   scheme is specific to TCP-based services because the name delegation
863   process depends on TCP for establishing authority.
864   An HTTP service based on some other underlying connection protocol
865   would presumably be identified using a different URI scheme, just as
866   the "https" scheme (below) is used for resources that require an
867   end-to-end secured connection. Other protocols might also be used to
868   provide access to "http" identified resources — it is only the
869   authoritative interface that is specific to TCP.
872   The URI generic syntax for authority also includes a deprecated
873   userinfo subcomponent (<xref target="RFC3986"/>, Section 3.2.1)
874   for including user authentication information in the URI.  Some
875   implementations make use of the userinfo component for internal
876   configuration of authentication information, such as within command
877   invocation options, configuration files, or bookmark lists, even
878   though such usage might expose a user identifier or password.
879   A sender MUST NOT generate the userinfo subcomponent (and its "@"
880   delimiter) when an "http" URI reference is generated within a message as a
881   request target or header field value.
882   Before making use of an "http" URI reference received from an untrusted
883   source, a recipient SHOULD parse for userinfo and treat its presence as
884   an error; it is likely being used to obscure the authority for the sake of
885   phishing attacks.
889<section title="https URI scheme" anchor="https.uri">
891   <iref item="https URI scheme"/>
892   <iref item="URI scheme" subitem="https"/>
894   The "https" URI scheme is hereby defined for the purpose of minting
895   identifiers according to their association with the hierarchical
896   namespace governed by a potential HTTP origin server listening to a
897   given TCP port for TLS-secured connections (<xref target="RFC5246"/>).
900   All of the requirements listed above for the "http" scheme are also
901   requirements for the "https" scheme, except that TCP port 443 is the
902   default if the port subcomponent is empty or not given,
903   and the user agent MUST ensure that its connection to the origin
904   server is secured through the use of strong encryption, end-to-end,
905   prior to sending the first HTTP request.
907<figure><iref primary="true" item="Grammar" subitem="https-URI"><!--terminal production--></iref><artwork type="abnf2616"><![CDATA[
908  https-URI = "https:" "//" authority path-abempty [ "?" query ]
909              [ "#" fragment ]
912   Note that the "https" URI scheme depends on both TLS and TCP for
913   establishing authority.
914   Resources made available via the "https" scheme have no shared
915   identity with the "http" scheme even if their resource identifiers
916   indicate the same authority (the same host listening to the same
917   TCP port).  They are distinct name spaces and are considered to be
918   distinct origin servers.  However, an extension to HTTP that is
919   defined to apply to entire host domains, such as the Cookie protocol
920   <xref target="RFC6265"/>, can allow information
921   set by one service to impact communication with other services
922   within a matching group of host domains.
925   The process for authoritative access to an "https" identified
926   resource is defined in <xref target="RFC2818"/>.
930<section title="http and https URI Normalization and Comparison" anchor="uri.comparison">
932   Since the "http" and "https" schemes conform to the URI generic syntax,
933   such URIs are normalized and compared according to the algorithm defined
934   in Section 6 of <xref target="RFC3986"/>, using the defaults
935   described above for each scheme.
938   If the port is equal to the default port for a scheme, the normal form is
939   to omit the port subcomponent. When not being used in absolute form as the
940   request target of an OPTIONS request, an empty path component is equivalent
941   to an absolute path of "/", so the normal form is to provide a path of "/"
942   instead. The scheme and host are case-insensitive and normally provided in
943   lowercase; all other components are compared in a case-sensitive manner.
944   Characters other than those in the "reserved" set are equivalent to their
945   percent-encoded octets: the normal form is to not encode them
946   (see Sections 2.1 and
947   2.2 of
948   <xref target="RFC3986"/>).
951   For example, the following three URIs are equivalent:
953<figure><artwork type="example"><![CDATA[
962<section title="Message Format" anchor="http.message">
967<iref item="header section"/>
968<iref item="headers"/>
969<iref item="header field"/>
971   All HTTP/1.1 messages consist of a start-line followed by a sequence of
972   octets in a format similar to the Internet Message Format
973   <xref target="RFC5322"/>: zero or more header fields (collectively
974   referred to as the "headers" or the "header section"), an empty line
975   indicating the end of the header section, and an optional message body.
977<figure><iref primary="true" item="Grammar" subitem="HTTP-message"><!--terminal production--></iref><artwork type="abnf2616"><![CDATA[
978  HTTP-message   = start-line
979                   *( header-field CRLF )
980                   CRLF
981                   [ message-body ]
984   The normal procedure for parsing an HTTP message is to read the
985   start-line into a structure, read each header field into a hash
986   table by field name until the empty line, and then use the parsed
987   data to determine if a message body is expected.  If a message body
988   has been indicated, then it is read as a stream until an amount
989   of octets equal to the message body length is read or the connection
990   is closed.
993   A recipient MUST parse an HTTP message as a sequence of octets in an
994   encoding that is a superset of US-ASCII <xref target="USASCII"/>.
995   Parsing an HTTP message as a stream of Unicode characters, without regard
996   for the specific encoding, creates security vulnerabilities due to the
997   varying ways that string processing libraries handle invalid multibyte
998   character sequences that contain the octet LF (%x0A).  String-based
999   parsers can only be safely used within protocol elements after the element
1000   has been extracted from the message, such as within a header field-value
1001   after message parsing has delineated the individual fields.
1004   An HTTP message can be parsed as a stream for incremental processing or
1005   forwarding downstream.  However, recipients cannot rely on incremental
1006   delivery of partial messages, since some implementations will buffer or
1007   delay message forwarding for the sake of network efficiency, security
1008   checks, or payload transformations.
1011   A sender MUST NOT send whitespace between the start-line and
1012   the first header field.
1013   A recipient that receives whitespace between the start-line and
1014   the first header field MUST either reject the message as invalid or
1015   consume each whitespace-preceded line without further processing of it
1016   (i.e., ignore the entire line, along with any subsequent lines preceded
1017   by whitespace, until a properly formed header field is received or the
1018   header section is terminated).
1021   The presence of such whitespace in a request
1022   might be an attempt to trick a server into ignoring that field or
1023   processing the line after it as a new request, either of which might
1024   result in a security vulnerability if other implementations within
1025   the request chain interpret the same message differently.
1026   Likewise, the presence of such whitespace in a response might be
1027   ignored by some clients or cause others to cease parsing.
1030<section title="Start Line" anchor="start.line">
1033   An HTTP message can either be a request from client to server or a
1034   response from server to client.  Syntactically, the two types of message
1035   differ only in the start-line, which is either a request-line (for requests)
1036   or a status-line (for responses), and in the algorithm for determining
1037   the length of the message body (<xref target="message.body"/>).
1040   In theory, a client could receive requests and a server could receive
1041   responses, distinguishing them by their different start-line formats,
1042   but in practice servers are implemented to only expect a request
1043   (a response is interpreted as an unknown or invalid request method)
1044   and clients are implemented to only expect a response.
1046<figure><iref primary="true" item="Grammar" subitem="start-line"/><artwork type="abnf2616"><![CDATA[
1047  start-line     = request-line / status-line
1050<section title="Request Line" anchor="request.line">
1054   A request-line begins with a method token, followed by a single
1055   space (SP), the request-target, another single space (SP), the
1056   protocol version, and ending with CRLF.
1058<figure><iref primary="true" item="Grammar" subitem="request-line"/><artwork type="abnf2616"><![CDATA[
1059  request-line   = method SP request-target SP HTTP-version CRLF
1061<iref primary="true" item="method"/>
1062<t anchor="method">
1063   The method token indicates the request method to be performed on the
1064   target resource. The request method is case-sensitive.
1066<figure><iref primary="true" item="Grammar" subitem="method"/><artwork type="abnf2616"><![CDATA[
1067  method         = token
1070   The request methods defined by this specification can be found in
1071   Section 4 of <xref target="Part2"/>, along with information regarding the HTTP method registry
1072   and considerations for defining new methods.
1074<iref item="request-target"/>
1076   The request-target identifies the target resource upon which to apply
1077   the request, as defined in <xref target="request-target"/>.
1080   Recipients typically parse the request-line into its component parts by
1081   splitting on whitespace (see <xref target="message.robustness"/>), since
1082   no whitespace is allowed in the three components.
1083   Unfortunately, some user agents fail to properly encode or exclude
1084   whitespace found in hypertext references, resulting in those disallowed
1085   characters being sent in a request-target.
1088   Recipients of an invalid request-line SHOULD respond with either a
1089   400 (Bad Request) error or a 301 (Moved Permanently)
1090   redirect with the request-target properly encoded.  A recipient SHOULD NOT
1091   attempt to autocorrect and then process the request without a redirect,
1092   since the invalid request-line might be deliberately crafted to bypass
1093   security filters along the request chain.
1096   HTTP does not place a pre-defined limit on the length of a request-line,
1097   as described in <xref target="conformance"/>.
1098   A server that receives a method longer than any that it implements
1099   SHOULD respond with a 501 (Not Implemented) status code.
1100   A server that receives a request-target longer than any URI it wishes to
1101   parse MUST respond with a
1102   414 (URI Too Long) status code (see Section 6.5.12 of <xref target="Part2"/>).
1105   Various ad-hoc limitations on request-line length are found in practice.
1106   It is RECOMMENDED that all HTTP senders and recipients support, at a
1107   minimum, request-line lengths of 8000 octets.
1111<section title="Status Line" anchor="status.line">
1117   The first line of a response message is the status-line, consisting
1118   of the protocol version, a space (SP), the status code, another space,
1119   a possibly-empty textual phrase describing the status code, and
1120   ending with CRLF.
1122<figure><iref primary="true" item="Grammar" subitem="status-line"/><artwork type="abnf2616"><![CDATA[
1123  status-line = HTTP-version SP status-code SP reason-phrase CRLF
1126   The status-code element is a 3-digit integer code describing the
1127   result of the server's attempt to understand and satisfy the client's
1128   corresponding request. The rest of the response message is to be
1129   interpreted in light of the semantics defined for that status code.
1130   See Section 6 of <xref target="Part2"/> for information about the semantics of status codes,
1131   including the classes of status code (indicated by the first digit),
1132   the status codes defined by this specification, considerations for the
1133   definition of new status codes, and the IANA registry.
1135<figure><iref primary="true" item="Grammar" subitem="status-code"/><artwork type="abnf2616"><![CDATA[
1136  status-code    = 3DIGIT
1139   The reason-phrase element exists for the sole purpose of providing a
1140   textual description associated with the numeric status code, mostly
1141   out of deference to earlier Internet application protocols that were more
1142   frequently used with interactive text clients. A client SHOULD ignore
1143   the reason-phrase content.
1145<figure><iref primary="true" item="Grammar" subitem="reason-phrase"/><artwork type="abnf2616"><![CDATA[
1146  reason-phrase  = *( HTAB / SP / VCHAR / obs-text )
1151<section title="Header Fields" anchor="header.fields">
1159   Each header field consists of a case-insensitive field name
1160   followed by a colon (":"), optional leading whitespace, the field value,
1161   and optional trailing whitespace.
1163<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-vchar"/><iref primary="true" item="Grammar" subitem="field-content"/><iref primary="true" item="Grammar" subitem="obs-fold"/><artwork type="abnf2616"><![CDATA[
1164  header-field   = field-name ":" OWS field-value OWS
1166  field-name     = token
1167  field-value    = *( field-content / obs-fold )
1168  field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]
1169  field-vchar    = VCHAR / obs-text
1171  obs-fold       = CRLF 1*( SP / HTAB )
1172                 ; obsolete line folding
1173                 ; see Section 3.2.4
1176   The field-name token labels the corresponding field-value as having the
1177   semantics defined by that header field.  For example, the Date
1178   header field is defined in Section of <xref target="Part2"/> as containing the origination
1179   timestamp for the message in which it appears.
1182<section title="Field Extensibility" anchor="field.extensibility">
1184   Header fields are fully extensible: there is no limit on the
1185   introduction of new field names, each presumably defining new semantics,
1186   nor on the number of header fields used in a given message.  Existing
1187   fields are defined in each part of this specification and in many other
1188   specifications outside this document set.
1191   New header fields can be defined such that, when they are understood by a
1192   recipient, they might override or enhance the interpretation of previously
1193   defined header fields, define preconditions on request evaluation, or
1194   refine the meaning of responses.
1197   A proxy MUST forward unrecognized header fields unless the
1198   field-name is listed in the <xref target="header.connection" format="none">Connection</xref> header field
1199   (<xref target="header.connection"/>) or the proxy is specifically
1200   configured to block, or otherwise transform, such fields.
1201   Other recipients SHOULD ignore unrecognized header fields.
1202   These requirements allow HTTP's functionality to be enhanced without
1203   requiring prior update of deployed intermediaries.
1206   All defined header fields ought to be registered with IANA in the
1207   Message Header Field Registry, as described in Section 8.3 of <xref target="Part2"/>.
1211<section title="Field Order" anchor="field.order">
1213   The order in which header fields with differing field names are
1214   received is not significant. However, it is good practice to send
1215   header fields that contain control data first, such as <xref target="" format="none">Host</xref>
1216   on requests and Date on responses, so that implementations
1217   can decide when not to handle a message as early as possible.
1218   A server MUST NOT apply a request to the target resource until the entire
1219   request header section is received, since later header fields might include
1220   conditionals, authentication credentials, or deliberately misleading
1221   duplicate header fields that would impact request processing.
1224   A sender MUST NOT generate multiple header fields with the same field
1225   name in a message unless either the entire field value for that
1226   header field is defined as a comma-separated list [i.e., #(values)]
1227   or the header field is a well-known exception (as noted below).
1230   A recipient MAY combine multiple header fields with the same field name
1231   into one "field-name: field-value" pair, without changing the semantics of
1232   the message, by appending each subsequent field value to the combined
1233   field value in order, separated by a comma. The order in which
1234   header fields with the same field name are received is therefore
1235   significant to the interpretation of the combined field value;
1236   a proxy MUST NOT change the order of these field values when
1237   forwarding a message.
1240  <t>
1241   Note: In practice, the "Set-Cookie" header field (<xref target="RFC6265"/>)
1242   often appears multiple times in a response message and does not use the
1243   list syntax, violating the above requirements on multiple header fields
1244   with the same name. Since it cannot be combined into a single field-value,
1245   recipients ought to handle "Set-Cookie" as a special case while processing
1246   header fields. (See Appendix A.2.3 of <xref target="Kri2001"/> for details.)
1247  </t>
1251<section title="Whitespace" anchor="whitespace">
1252<t anchor="rule.LWS">
1253   This specification uses three rules to denote the use of linear
1254   whitespace: OWS (optional whitespace), RWS (required whitespace), and
1255   BWS ("bad" whitespace).
1257<t anchor="rule.OWS">
1258   The OWS rule is used where zero or more linear whitespace octets might
1259   appear. For protocol elements where optional whitespace is preferred to
1260   improve readability, a sender SHOULD generate the optional whitespace
1261   as a single SP; otherwise, a sender SHOULD NOT generate optional
1262   whitespace except as needed to white-out invalid or unwanted protocol
1263   elements during in-place message filtering.
1265<t anchor="rule.RWS">
1266   The RWS rule is used when at least one linear whitespace octet is required
1267   to separate field tokens. A sender SHOULD generate RWS as a single SP.
1269<t anchor="rule.BWS">
1270   The BWS rule is used where the grammar allows optional whitespace only for
1271   historical reasons. A sender MUST NOT generate BWS in messages.
1272   A recipient MUST parse for such bad whitespace and remove it before
1273   interpreting the protocol element.
1275<t anchor="rule.whitespace">
1280<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[
1281  OWS            = *( SP / HTAB )
1282                 ; optional whitespace
1283  RWS            = 1*( SP / HTAB )
1284                 ; required whitespace
1285  BWS            = OWS
1286                 ; "bad" whitespace
1290<section title="Field Parsing" anchor="field.parsing">
1292   Messages are parsed using a generic algorithm, independent of the
1293   individual header field names. The contents within a given field value are
1294   not parsed until a later stage of message interpretation (usually after the
1295   message's entire header section has been processed).
1296   Consequently, this specification does not use ABNF rules to define each
1297   "Field-Name: Field Value" pair, as was done in previous editions.
1298   Instead, this specification uses ABNF rules which are named according to
1299   each registered field name, wherein the rule defines the valid grammar for
1300   that field's corresponding field values (i.e., after the field-value
1301   has been extracted from the header section by a generic field parser).
1304   No whitespace is allowed between the header field-name and colon.
1305   In the past, differences in the handling of such whitespace have led to
1306   security vulnerabilities in request routing and response handling.
1307   A server MUST reject any received request message that contains
1308   whitespace between a header field-name and colon with a response code of
1309   400 (Bad Request). A proxy MUST remove any such whitespace
1310   from a response message before forwarding the message downstream.
1313   A field value might be preceded and/or followed by optional whitespace
1314   (OWS); a single SP preceding the field-value is preferred for consistent
1315   readability by humans.
1316   The field value does not include any leading or trailing white space: OWS
1317   occurring before the first non-whitespace octet of the field value or after
1318   the last non-whitespace octet of the field value ought to be excluded by
1319   parsers when extracting the field value from a header field.
1322   Historically, HTTP header field values could be extended over multiple
1323   lines by preceding each extra line with at least one space or horizontal
1324   tab (obs-fold). This specification deprecates such line folding except
1325   within the message/http media type
1326   (<xref target=""/>).
1327   A sender MUST NOT generate a message that includes line folding
1328   (i.e., that has any field-value that contains a match to the
1329   <xref target="header.fields" format="none">obs-fold</xref> rule) unless the message is intended for packaging
1330   within the message/http media type.
1333   A server that receives an <xref target="header.fields" format="none">obs-fold</xref> in a request message that
1334   is not within a message/http container MUST either reject the message by
1335   sending a 400 (Bad Request), preferably with a
1336   representation explaining that obsolete line folding is unacceptable, or
1337   replace each received <xref target="header.fields" format="none">obs-fold</xref> with one or more
1338   <xref target="core.rules" format="none">SP</xref> octets prior to interpreting the field value or
1339   forwarding the message downstream.
1342   A proxy or gateway that receives an <xref target="header.fields" format="none">obs-fold</xref> in a response
1343   message that is not within a message/http container MUST either discard
1344   the message and replace it with a 502 (Bad Gateway)
1345   response, preferably with a representation explaining that unacceptable
1346   line folding was received, or replace each received <xref target="header.fields" format="none">obs-fold</xref>
1347   with one or more <xref target="core.rules" format="none">SP</xref> octets prior to interpreting the field
1348   value or forwarding the message downstream.
1351   A user agent that receives an <xref target="header.fields" format="none">obs-fold</xref> in a response message
1352   that is not within a message/http container MUST replace each received
1353   <xref target="header.fields" format="none">obs-fold</xref> with one or more <xref target="core.rules" format="none">SP</xref> octets prior to
1354   interpreting the field value.
1357   Historically, HTTP has allowed field content with text in the ISO-8859-1
1358   <xref target="ISO-8859-1"/> charset, supporting other charsets only
1359   through use of <xref target="RFC2047"/> encoding.
1360   In practice, most HTTP header field values use only a subset of the
1361   US-ASCII charset <xref target="USASCII"/>. Newly defined
1362   header fields SHOULD limit their field values to US-ASCII octets.
1363   A recipient SHOULD treat other octets in field content (obs-text) as
1364   opaque data.
1368<section title="Field Limits" anchor="field.limits">
1370   HTTP does not place a pre-defined limit on the length of each header field
1371   or on the length of the header section as a whole, as described in
1372   <xref target="conformance"/>. Various ad-hoc limitations on individual
1373   header field length are found in practice, often depending on the specific
1374   field semantics.
1377   A server that receives a request header field, or set of fields, larger
1378   than it wishes to process MUST respond with an appropriate
1379   4xx (Client Error) status code. Ignoring such header fields
1380   would increase the server's vulnerability to request smuggling attacks
1381   (<xref target="request.smuggling"/>).
1384   A client MAY discard or truncate received header fields that are larger
1385   than the client wishes to process if the field semantics are such that the
1386   dropped value(s) can be safely ignored without changing the
1387   message framing or response semantics.
1391<section title="Field value components" anchor="field.components">
1392<t anchor="rule.token.separators">
1395  <iref item="Delimiters"/>
1396   Most HTTP header field values are defined using common syntax components
1397   (token, quoted-string, and comment) separated by whitespace or specific
1398   delimiting characters. Delimiters are chosen from the set of US-ASCII
1399   visual characters not allowed in a <xref target="rule.token.separators" format="none">token</xref>
1400   (DQUOTE and "(),/:;&lt;=&gt;?@[\]{}").
1402<figure><iref primary="true" item="Grammar" subitem="token"/><iref primary="true" item="Grammar" subitem="tchar"/><artwork type="abnf2616"><![CDATA[
1403  token          = 1*tchar
1405  tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
1406                 / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
1407                 / DIGIT / ALPHA
1408                 ; any VCHAR, except delimiters
1410<t anchor="rule.quoted-string">
1414   A string of text is parsed as a single value if it is quoted using
1415   double-quote marks.
1417<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[
1418  quoted-string  = DQUOTE *( qdtext / quoted-pair ) DQUOTE
1419  qdtext         = HTAB / SP /%x21 / %x23-5B / %x5D-7E / obs-text
1420  obs-text       = %x80-FF
1422<t anchor="rule.comment">
1425   Comments can be included in some HTTP header fields by surrounding
1426   the comment text with parentheses. Comments are only allowed in
1427   fields containing "comment" as part of their field value definition.
1429<figure><iref primary="true" item="Grammar" subitem="comment"/><iref primary="true" item="Grammar" subitem="ctext"/><artwork type="abnf2616"><![CDATA[
1430  comment        = "(" *( ctext / quoted-pair / comment ) ")"
1431  ctext          = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text
1433<t anchor="rule.quoted-pair">
1435   The backslash octet ("\") can be used as a single-octet
1436   quoting mechanism within quoted-string and comment constructs.
1437   Recipients that process the value of a quoted-string MUST handle a
1438   quoted-pair as if it were replaced by the octet following the backslash.
1440<figure><iref primary="true" item="Grammar" subitem="quoted-pair"/><artwork type="abnf2616"><![CDATA[
1441  quoted-pair    = "\" ( HTAB / SP / VCHAR / obs-text )
1444   A sender SHOULD NOT generate a quoted-pair in a quoted-string except
1445   where necessary to quote DQUOTE and backslash octets occurring within that
1446   string.
1447   A sender SHOULD NOT generate a quoted-pair in a comment except
1448   where necessary to quote parentheses ["(" and ")"] and backslash octets
1449   occurring within that comment.
1455<section title="Message Body" anchor="message.body">
1458   The message body (if any) of an HTTP message is used to carry the
1459   payload body of that request or response.  The message body is
1460   identical to the payload body unless a transfer coding has been
1461   applied, as described in <xref target="header.transfer-encoding"/>.
1463<figure><iref primary="true" item="Grammar" subitem="message-body"/><artwork type="abnf2616"><![CDATA[
1464  message-body = *OCTET
1467   The rules for when a message body is allowed in a message differ for
1468   requests and responses.
1471   The presence of a message body in a request is signaled by a
1472   <xref target="header.content-length" format="none">Content-Length</xref> or <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header
1473   field. Request message framing is independent of method semantics,
1474   even if the method does not define any use for a message body.
1477   The presence of a message body in a response depends on both
1478   the request method to which it is responding and the response
1479   status code (<xref target="status.line"/>).
1480   Responses to the HEAD request method (Section 4.3.2 of <xref target="Part2"/>) never include a message body
1481   because the associated response header fields (e.g.,
1482   <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref>, <xref target="header.content-length" format="none">Content-Length</xref>, etc.),
1483   if present, indicate only what their values would have been if the request
1484   method had been GET (Section 4.3.1 of <xref target="Part2"/>).
1485   2xx (Successful) responses to a CONNECT request method
1486   (Section 4.3.6 of <xref target="Part2"/>) switch to tunnel mode instead of having a message body.
1487   All 1xx (Informational), 204 (No Content), and
1488   304 (Not Modified) responses do not include a message body.
1489   All other responses do include a message body, although the body
1490   might be of zero length.
1493<section title="Transfer-Encoding" anchor="header.transfer-encoding">
1494  <iref primary="true" item="Transfer-Encoding header field"/>
1495  <iref item="chunked (Coding Format)"/>
1498   The Transfer-Encoding header field lists the transfer coding names
1499   corresponding to the sequence of transfer codings that have been
1500   (or will be) applied to the payload body in order to form the message body.
1501   Transfer codings are defined in <xref target="transfer.codings"/>.
1503<figure><iref primary="true" item="Grammar" subitem="Transfer-Encoding"/><artwork type="abnf2616"><![CDATA[
1504  Transfer-Encoding = 1#transfer-coding
1507   Transfer-Encoding is analogous to the Content-Transfer-Encoding field of
1508   MIME, which was designed to enable safe transport of binary data over a
1509   7-bit transport service (<xref target="RFC2045"/>, Section 6).
1510   However, safe transport has a different focus for an 8bit-clean transfer
1511   protocol. In HTTP's case, Transfer-Encoding is primarily intended to
1512   accurately delimit a dynamically generated payload and to distinguish
1513   payload encodings that are only applied for transport efficiency or
1514   security from those that are characteristics of the selected resource.
1517   A recipient MUST be able to parse the chunked transfer coding
1518   (<xref target="chunked.encoding"/>) because it plays a crucial role in
1519   framing messages when the payload body size is not known in advance.
1520   A sender MUST NOT apply chunked more than once to a message body
1521   (i.e., chunking an already chunked message is not allowed).
1522   If any transfer coding other than chunked is applied to a request payload
1523   body, the sender MUST apply chunked as the final transfer coding to
1524   ensure that the message is properly framed.
1525   If any transfer coding other than chunked is applied to a response payload
1526   body, the sender MUST either apply chunked as the final transfer coding
1527   or terminate the message by closing the connection.
1530   For example,
1531</preamble><artwork type="example"><![CDATA[
1532  Transfer-Encoding: gzip, chunked
1534   indicates that the payload body has been compressed using the gzip
1535   coding and then chunked using the chunked coding while forming the
1536   message body.
1539   Unlike Content-Encoding (Section of <xref target="Part2"/>),
1540   Transfer-Encoding is a property of the message, not of the representation, and
1541   any recipient along the request/response chain MAY decode the received
1542   transfer coding(s) or apply additional transfer coding(s) to the message
1543   body, assuming that corresponding changes are made to the Transfer-Encoding
1544   field-value. Additional information about the encoding parameters can be
1545   provided by other header fields not defined by this specification.
1548   Transfer-Encoding MAY be sent in a response to a HEAD request or in a
1549   304 (Not Modified) response (Section 4.1 of <xref target="Part4"/>) to a GET request,
1550   neither of which includes a message body,
1551   to indicate that the origin server would have applied a transfer coding
1552   to the message body if the request had been an unconditional GET.
1553   This indication is not required, however, because any recipient on
1554   the response chain (including the origin server) can remove transfer
1555   codings when they are not needed.
1558   A server MUST NOT send a Transfer-Encoding header field in any response
1559   with a status code of
1560   1xx (Informational) or 204 (No Content).
1561   A server MUST NOT send a Transfer-Encoding header field in any
1562   2xx (Successful) response to a CONNECT request (Section 4.3.6 of <xref target="Part2"/>).
1565   Transfer-Encoding was added in HTTP/1.1.  It is generally assumed that
1566   implementations advertising only HTTP/1.0 support will not understand
1567   how to process a transfer-encoded payload.
1568   A client MUST NOT send a request containing Transfer-Encoding unless it
1569   knows the server will handle HTTP/1.1 (or later) requests; such knowledge
1570   might be in the form of specific user configuration or by remembering the
1571   version of a prior received response.
1572   A server MUST NOT send a response containing Transfer-Encoding unless
1573   the corresponding request indicates HTTP/1.1 (or later).
1576   A server that receives a request message with a transfer coding it does
1577   not understand SHOULD respond with 501 (Not Implemented).
1581<section title="Content-Length" anchor="header.content-length">
1582  <iref primary="true" item="Content-Length header field"/>
1585   When a message does not have a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header
1586   field, a Content-Length header field can provide the anticipated size,
1587   as a decimal number of octets, for a potential payload body.
1588   For messages that do include a payload body, the Content-Length field-value
1589   provides the framing information necessary for determining where the body
1590   (and message) ends.  For messages that do not include a payload body, the
1591   Content-Length indicates the size of the selected representation
1592   (Section 3 of <xref target="Part2"/>).
1594<figure><iref primary="true" item="Grammar" subitem="Content-Length"/><artwork type="abnf2616"><![CDATA[
1595  Content-Length = 1*DIGIT
1598   An example is
1600<figure><artwork type="example"><![CDATA[
1601  Content-Length: 3495
1604   A sender MUST NOT send a Content-Length header field in any message that
1605   contains a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field.
1608   A user agent SHOULD send a Content-Length in a request message when no
1609   <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> is sent and the request method defines
1610   a meaning for an enclosed payload body. For example, a Content-Length
1611   header field is normally sent in a POST request even when the value is
1612   0 (indicating an empty payload body).  A user agent SHOULD NOT send a
1613   Content-Length header field when the request message does not contain a
1614   payload body and the method semantics do not anticipate such a body.
1617   A server MAY send a Content-Length header field in a response to a HEAD
1618   request (Section 4.3.2 of <xref target="Part2"/>); a server MUST NOT send Content-Length in such a
1619   response unless its field-value equals the decimal number of octets that
1620   would have been sent in the payload body of a response if the same
1621   request had used the GET method.
1624   A server MAY send a Content-Length header field in a
1625   304 (Not Modified) response to a conditional GET request
1626   (Section 4.1 of <xref target="Part4"/>); a server MUST NOT send Content-Length in such a
1627   response unless its field-value equals the decimal number of octets that
1628   would have been sent in the payload body of a 200 (OK)
1629   response to the same request.
1632   A server MUST NOT send a Content-Length header field in any response
1633   with a status code of
1634   1xx (Informational) or 204 (No Content).
1635   A server MUST NOT send a Content-Length header field in any
1636   2xx (Successful) response to a CONNECT request (Section 4.3.6 of <xref target="Part2"/>).
1639   Aside from the cases defined above, in the absence of Transfer-Encoding,
1640   an origin server SHOULD send a Content-Length header field when the
1641   payload body size is known prior to sending the complete header section.
1642   This will allow downstream recipients to measure transfer progress,
1643   know when a received message is complete, and potentially reuse the
1644   connection for additional requests.
1647   Any Content-Length field value greater than or equal to zero is valid.
1648   Since there is no predefined limit to the length of a payload, a
1649   recipient MUST anticipate potentially large decimal numerals and
1650   prevent parsing errors due to integer conversion overflows
1651   (<xref target="attack.protocol.element.length"/>).
1654   If a message is received that has multiple Content-Length header fields
1655   with field-values consisting of the same decimal value, or a single
1656   Content-Length header field with a field value containing a list of
1657   identical decimal values (e.g., "Content-Length: 42, 42"), indicating that
1658   duplicate Content-Length header fields have been generated or combined by an
1659   upstream message processor, then the recipient MUST either reject the
1660   message as invalid or replace the duplicated field-values with a single
1661   valid Content-Length field containing that decimal value prior to
1662   determining the message body length or forwarding the message.
1665  <t>
1666   Note: HTTP's use of Content-Length for message framing differs
1667   significantly from the same field's use in MIME, where it is an optional
1668   field used only within the "message/external-body" media-type.
1669  </t>
1673<section title="Message Body Length" anchor="message.body.length">
1674  <iref item="chunked (Coding Format)"/>
1676   The length of a message body is determined by one of the following
1677   (in order of precedence):
1680  <list style="numbers">
1681    <t>
1682     Any response to a HEAD request and any response with a
1683     1xx (Informational), 204 (No Content), or
1684     304 (Not Modified) status code is always
1685     terminated by the first empty line after the header fields, regardless of
1686     the header fields present in the message, and thus cannot contain a
1687     message body.
1688    </t>
1689    <t>
1690     Any 2xx (Successful) response to a CONNECT request implies that the
1691     connection will become a tunnel immediately after the empty line that
1692     concludes the header fields.  A client MUST ignore any
1693     <xref target="header.content-length" format="none">Content-Length</xref> or <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header
1694     fields received in such a message.
1695    </t>
1696    <t>
1697     If a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field is present
1698     and the chunked transfer coding (<xref target="chunked.encoding"/>)
1699     is the final encoding, the message body length is determined by reading
1700     and decoding the chunked data until the transfer coding indicates the
1701     data is complete.
1702    <vspace blankLines="1"/>
1703     If a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field is present in a
1704     response and the chunked transfer coding is not the final encoding, the
1705     message body length is determined by reading the connection until it is
1706     closed by the server.
1707     If a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field is present in a request and the
1708     chunked transfer coding is not the final encoding, the message body
1709     length cannot be determined reliably; the server MUST respond with
1710     the 400 (Bad Request) status code and then close the connection.
1711    <vspace blankLines="1"/>
1712     If a message is received with both a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref>
1713     and a <xref target="header.content-length" format="none">Content-Length</xref> header field, the Transfer-Encoding
1714     overrides the Content-Length. Such a message might indicate an attempt to
1715     perform request smuggling (<xref target="request.smuggling"/>) or
1716     response splitting (<xref target="response.splitting"/>) and ought to be
1717     handled as an error. A sender MUST remove the received Content-Length
1718     field prior to forwarding such a message downstream.
1719    </t>
1720    <t>
1721     If a message is received without <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> and with
1722     either multiple <xref target="header.content-length" format="none">Content-Length</xref> header fields having
1723     differing field-values or a single Content-Length header field having an
1724     invalid value, then the message framing is invalid and
1725     the recipient MUST treat it as an unrecoverable error.
1726     If this is a request message, the server MUST respond with
1727     a 400 (Bad Request) status code and then close the connection.
1728     If this is a response message received by a proxy,
1729     the proxy MUST close the connection to the server, discard the received
1730     response, and send a 502 (Bad Gateway) response to the
1731     client.
1732     If this is a response message received by a user agent,
1733     the user agent MUST close the connection to the server and discard the
1734     received response.
1735    </t>
1736    <t>
1737     If a valid <xref target="header.content-length" format="none">Content-Length</xref> header field is present without
1738     <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref>, its decimal value defines the
1739     expected message body length in octets.
1740     If the sender closes the connection or the recipient times out before the
1741     indicated number of octets are received, the recipient MUST consider
1742     the message to be incomplete and close the connection.
1743    </t>
1744    <t>
1745     If this is a request message and none of the above are true, then the
1746     message body length is zero (no message body is present).
1747    </t>
1748    <t>
1749     Otherwise, this is a response message without a declared message body
1750     length, so the message body length is determined by the number of octets
1751     received prior to the server closing the connection.
1752    </t>
1753  </list>
1756   Since there is no way to distinguish a successfully completed,
1757   close-delimited message from a partially-received message interrupted
1758   by network failure, a server SHOULD generate encoding or
1759   length-delimited messages whenever possible.  The close-delimiting
1760   feature exists primarily for backwards compatibility with HTTP/1.0.
1763   A server MAY reject a request that contains a message body but
1764   not a <xref target="header.content-length" format="none">Content-Length</xref> by responding with
1765   411 (Length Required).
1768   Unless a transfer coding other than chunked has been applied,
1769   a client that sends a request containing a message body SHOULD
1770   use a valid <xref target="header.content-length" format="none">Content-Length</xref> header field if the message body
1771   length is known in advance, rather than the chunked transfer coding, since some
1772   existing services respond to chunked with a 411 (Length Required)
1773   status code even though they understand the chunked transfer coding.  This
1774   is typically because such services are implemented via a gateway that
1775   requires a content-length in advance of being called and the server
1776   is unable or unwilling to buffer the entire request before processing.
1779   A user agent that sends a request containing a message body MUST send a
1780   valid <xref target="header.content-length" format="none">Content-Length</xref> header field if it does not know the
1781   server will handle HTTP/1.1 (or later) requests; such knowledge can be in
1782   the form of specific user configuration or by remembering the version of a
1783   prior received response.
1786   If the final response to the last request on a connection has been
1787   completely received and there remains additional data to read, a user agent
1788   MAY discard the remaining data or attempt to determine if that data
1789   belongs as part of the prior response body, which might be the case if the
1790   prior message's Content-Length value is incorrect. A client MUST NOT
1791   process, cache, or forward such extra data as a separate response, since
1792   such behavior would be vulnerable to cache poisoning.
1797<section anchor="incomplete.messages" title="Handling Incomplete Messages">
1799   A server that receives an incomplete request message, usually due to a
1800   canceled request or a triggered time-out exception, MAY send an error
1801   response prior to closing the connection.
1804   A client that receives an incomplete response message, which can occur
1805   when a connection is closed prematurely or when decoding a supposedly
1806   chunked transfer coding fails, MUST record the message as incomplete.
1807   Cache requirements for incomplete responses are defined in
1808   Section 3 of <xref target="Part6"/>.
1811   If a response terminates in the middle of the header section (before the
1812   empty line is received) and the status code might rely on header fields to
1813   convey the full meaning of the response, then the client cannot assume
1814   that meaning has been conveyed; the client might need to repeat the
1815   request in order to determine what action to take next.
1818   A message body that uses the chunked transfer coding is
1819   incomplete if the zero-sized chunk that terminates the encoding has not
1820   been received.  A message that uses a valid <xref target="header.content-length" format="none">Content-Length</xref> is
1821   incomplete if the size of the message body received (in octets) is less than
1822   the value given by Content-Length.  A response that has neither chunked
1823   transfer coding nor Content-Length is terminated by closure of the
1824   connection, and thus is considered complete regardless of the number of
1825   message body octets received, provided that the header section was received
1826   intact.
1830<section title="Message Parsing Robustness" anchor="message.robustness">
1832   Older HTTP/1.0 user agent implementations might send an extra CRLF
1833   after a POST request as a workaround for some early server
1834   applications that failed to read message body content that was
1835   not terminated by a line-ending. An HTTP/1.1 user agent MUST NOT
1836   preface or follow a request with an extra CRLF.  If terminating
1837   the request message body with a line-ending is desired, then the
1838   user agent MUST count the terminating CRLF octets as part of the
1839   message body length.
1842   In the interest of robustness, a server that is expecting to receive and
1843   parse a request-line SHOULD ignore at least one empty line (CRLF)
1844   received prior to the request-line.
1847   Although the line terminator for the start-line and header
1848   fields is the sequence CRLF, a recipient MAY recognize a
1849   single LF as a line terminator and ignore any preceding CR.
1852   Although the request-line and status-line grammar rules require that each
1853   of the component elements be separated by a single SP octet, recipients
1854   MAY instead parse on whitespace-delimited word boundaries and, aside
1855   from the CRLF terminator, treat any form of whitespace as the SP separator
1856   while ignoring preceding or trailing whitespace;
1857   such whitespace includes one or more of the following octets:
1858   SP, HTAB, VT (%x0B), FF (%x0C), or bare CR.
1859   However, lenient parsing can result in security vulnerabilities if there
1860   are multiple recipients of the message and each has its own unique
1861   interpretation of robustness (see <xref target="request.smuggling"/>).
1864   When a server listening only for HTTP request messages, or processing
1865   what appears from the start-line to be an HTTP request message,
1866   receives a sequence of octets that does not match the HTTP-message
1867   grammar aside from the robustness exceptions listed above, the
1868   server SHOULD respond with a 400 (Bad Request) response. 
1873<section title="Transfer Codings" anchor="transfer.codings">
1877   Transfer coding names are used to indicate an encoding
1878   transformation that has been, can be, or might need to be applied to a
1879   payload body in order to ensure "safe transport" through the network.
1880   This differs from a content coding in that the transfer coding is a
1881   property of the message rather than a property of the representation
1882   that is being transferred.
1884<figure><iref primary="true" item="Grammar" subitem="transfer-coding"/><iref primary="true" item="Grammar" subitem="transfer-extension"/><artwork type="abnf2616"><![CDATA[
1885  transfer-coding    = "chunked" ; Section 4.1
1886                     / "compress" ; Section 4.2.1
1887                     / "deflate" ; Section 4.2.2
1888                     / "gzip" ; Section 4.2.3
1889                     / transfer-extension
1890  transfer-extension = token *( OWS ";" OWS transfer-parameter )
1892<t anchor="rule.parameter">
1894   Parameters are in the form of a name or name=value pair.
1896<figure><iref primary="true" item="Grammar" subitem="transfer-parameter"/><artwork type="abnf2616"><![CDATA[
1897  transfer-parameter = token BWS "=" BWS ( token / quoted-string )
1900   All transfer-coding names are case-insensitive and ought to be registered
1901   within the HTTP Transfer Coding registry, as defined in
1902   <xref target="transfer.coding.registry"/>.
1903   They are used in the <xref target="header.te" format="none">TE</xref> (<xref target="header.te"/>) and
1904   <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> (<xref target="header.transfer-encoding"/>)
1905   header fields.
1908<section title="Chunked Transfer Coding" anchor="chunked.encoding">
1909  <iref primary="true" item="chunked (Coding Format)"/>
1916   The chunked transfer coding wraps the payload body in order to transfer it
1917   as a series of chunks, each with its own size indicator, followed by an
1918   OPTIONAL trailer containing header fields. Chunked enables content
1919   streams of unknown size to be transferred as a sequence of length-delimited
1920   buffers, which enables the sender to retain connection persistence and the
1921   recipient to know when it has received the entire message.
1923<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="false" item="Grammar" subitem="trailer-part"/><iref primary="false" item="Grammar" subitem="chunk-ext"/><iref primary="true" item="Grammar" subitem="chunk-data"/><artwork type="abnf2616"><![CDATA[
1924  chunked-body   = *chunk
1925                   last-chunk
1926                   trailer-part
1927                   CRLF
1929  chunk          = chunk-size [ chunk-ext ] CRLF
1930                   chunk-data CRLF
1931  chunk-size     = 1*HEXDIG
1932  last-chunk     = 1*("0") [ chunk-ext ] CRLF
1934  chunk-data     = 1*OCTET ; a sequence of chunk-size octets
1937   The chunk-size field is a string of hex digits indicating the size of
1938   the chunk-data in octets. The chunked transfer coding is complete when a
1939   chunk with a chunk-size of zero is received, possibly followed by a
1940   trailer, and finally terminated by an empty line.
1943   A recipient MUST be able to parse and decode the chunked transfer coding.
1946<section title="Chunk Extensions" anchor="chunked.extension">
1951   The chunked encoding allows each chunk to include zero or more chunk
1952   extensions, immediately following the <xref target="chunked.encoding" format="none">chunk-size</xref>, for the
1953   sake of supplying per-chunk metadata (such as a signature or hash),
1954   mid-message control information, or randomization of message body size.
1956<figure><iref primary="true" item="Grammar" subitem="chunked-body"><!--terminal production--></iref><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"/><artwork type="abnf2616"><![CDATA[
1957  chunk-ext      = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
1959  chunk-ext-name = token
1960  chunk-ext-val  = token / quoted-string
1963   The chunked encoding is specific to each connection and is likely to be
1964   removed or recoded by each recipient (including intermediaries) before any
1965   higher-level application would have a chance to inspect the extensions.
1966   Hence, use of chunk extensions is generally limited to specialized HTTP
1967   services such as "long polling" (where client and server can have shared
1968   expectations regarding the use of chunk extensions) or for padding within
1969   an end-to-end secured connection.
1972   A recipient MUST ignore unrecognized chunk extensions.
1973   A server ought to limit the total length of chunk extensions received in a
1974   request to an amount reasonable for the services provided, in the same way
1975   that it applies length limitations and timeouts for other parts of a
1976   message, and generate an appropriate 4xx (Client Error)
1977   response if that amount is exceeded.
1981<section title="Chunked Trailer Part" anchor="chunked.trailer.part">
1984   A trailer allows the sender to include additional fields at the end of a
1985   chunked message in order to supply metadata that might be dynamically
1986   generated while the message body is sent, such as a message integrity
1987   check, digital signature, or post-processing status. The trailer fields are
1988   identical to header fields, except they are sent in a chunked trailer
1989   instead of the message's header section.
1991<figure><iref primary="true" item="Grammar" subitem="trailer-part"/><iref primary="false" item="Grammar" subitem="header-field"/><artwork type="abnf2616"><![CDATA[
1992  trailer-part   = *( header-field CRLF )
1995   A sender MUST NOT generate a trailer that contains a field necessary for
1996   message framing (e.g., <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> and
1997   <xref target="header.content-length" format="none">Content-Length</xref>), routing (e.g., <xref target="" format="none">Host</xref>),
1998   request modifiers (e.g., controls and conditionals in
1999   Section 5 of <xref target="Part2"/>), authentication (e.g., see <xref target="Part7"/>
2000   and <xref target="RFC6265"/>), response control data (e.g., see
2001   Section 7.1 of <xref target="Part2"/>), or determining how to process the payload
2002   (e.g., Content-Encoding, Content-Type,
2003   Content-Range, and <xref target="header.trailer" format="none">Trailer</xref>).
2006   When a chunked message containing a non-empty trailer is received, the
2007   recipient MAY process the fields (aside from those forbidden above)
2008   as if they were appended to the message's header section.
2009   A recipient MUST ignore (or consider as an error) any fields that are
2010   forbidden to be sent in a trailer, since processing them as if they were
2011   present in the header section might bypass external security filters.
2014   Unless the request includes a <xref target="header.te" format="none">TE</xref> header field indicating
2015   "trailers" is acceptable, as described in <xref target="header.te"/>, a
2016   server SHOULD NOT generate trailer fields that it believes are necessary
2017   for the user agent to receive. Without a TE containing "trailers", the
2018   server ought to assume that the trailer fields might be silently discarded
2019   along the path to the user agent. This requirement allows intermediaries to
2020   forward a de-chunked message to an HTTP/1.0 recipient without buffering the
2021   entire response.
2025<section title="Decoding Chunked" anchor="decoding.chunked">
2027   A process for decoding the chunked transfer coding
2028   can be represented in pseudo-code as:
2030<figure><artwork type="code"><![CDATA[
2031  length := 0
2032  read chunk-size, chunk-ext (if any), and CRLF
2033  while (chunk-size > 0) {
2034     read chunk-data and CRLF
2035     append chunk-data to decoded-body
2036     length := length + chunk-size
2037     read chunk-size, chunk-ext (if any), and CRLF
2038  }
2039  read trailer field
2040  while (trailer field is not empty) {
2041     if (trailer field is allowed to be sent in a trailer) {
2042         append trailer field to existing header fields
2043     }
2044     read trailer-field
2045  }
2046  Content-Length := length
2047  Remove "chunked" from Transfer-Encoding
2048  Remove Trailer from existing header fields
2053<section title="Compression Codings" anchor="compression.codings">
2055   The codings defined below can be used to compress the payload of a
2056   message.
2059<section title="Compress Coding" anchor="compress.coding">
2060<iref item="compress (Coding Format)"/>
2062   The "compress" coding is an adaptive Lempel-Ziv-Welch (LZW) coding
2063   <xref target="Welch"/> that is commonly produced by the UNIX file
2064   compression program "compress".
2065   A recipient SHOULD consider "x-compress" to be equivalent to "compress".
2069<section title="Deflate Coding" anchor="deflate.coding">
2070<iref item="deflate (Coding Format)"/>
2072   The "deflate" coding is a "zlib" data format <xref target="RFC1950"/>
2073   containing a "deflate" compressed data stream <xref target="RFC1951"/>
2074   that uses a combination of the Lempel-Ziv (LZ77) compression algorithm and
2075   Huffman coding.
2078  <t>
2079    Note: Some non-conformant implementations send the "deflate"
2080    compressed data without the zlib wrapper.
2081   </t>
2085<section title="Gzip Coding" anchor="gzip.coding">
2086<iref item="gzip (Coding Format)"/>
2088   The "gzip" coding is an LZ77 coding with a 32 bit CRC that is commonly
2089   produced by the gzip file compression program <xref target="RFC1952"/>.
2090   A recipient SHOULD consider "x-gzip" to be equivalent to "gzip".
2096<section title="TE" anchor="header.te">
2097  <iref primary="true" item="TE header field"/>
2103   The "TE" header field in a request indicates what transfer codings,
2104   besides chunked, the client is willing to accept in response, and
2105   whether or not the client is willing to accept trailer fields in a
2106   chunked transfer coding.
2109   The TE field-value consists of a comma-separated list of transfer coding
2110   names, each allowing for optional parameters (as described in
2111   <xref target="transfer.codings"/>), and/or the keyword "trailers".
2112   A client MUST NOT send the chunked transfer coding name in TE;
2113   chunked is always acceptable for HTTP/1.1 recipients.
2115<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[
2116  TE        = #t-codings
2117  t-codings = "trailers" / ( transfer-coding [ t-ranking ] )
2118  t-ranking = OWS ";" OWS "q=" rank
2119  rank      = ( "0" [ "." 0*3DIGIT ] )
2120             / ( "1" [ "." 0*3("0") ] )
2123   Three examples of TE use are below.
2125<figure><artwork type="example"><![CDATA[
2126  TE: deflate
2127  TE:
2128  TE: trailers, deflate;q=0.5
2131   The presence of the keyword "trailers" indicates that the client is willing
2132   to accept trailer fields in a chunked transfer coding, as defined in
2133   <xref target="chunked.trailer.part"/>, on behalf of itself and any downstream
2134   clients. For requests from an intermediary, this implies that either:
2135   (a) all downstream clients are willing to accept trailer fields in the
2136   forwarded response; or,
2137   (b) the intermediary will attempt to buffer the response on behalf of
2138   downstream recipients.
2139   Note that HTTP/1.1 does not define any means to limit the size of a
2140   chunked response such that an intermediary can be assured of buffering the
2141   entire response.
2144   When multiple transfer codings are acceptable, the client MAY rank the
2145   codings by preference using a case-insensitive "q" parameter (similar to
2146   the qvalues used in content negotiation fields, Section 5.3.1 of <xref target="Part2"/>). The rank value
2147   is a real number in the range 0 through 1, where 0.001 is the least
2148   preferred and 1 is the most preferred; a value of 0 means "not acceptable".
2151   If the TE field-value is empty or if no TE field is present, the only
2152   acceptable transfer coding is chunked. A message with no transfer coding
2153   is always acceptable.
2156   Since the TE header field only applies to the immediate connection,
2157   a sender of TE MUST also send a "TE" connection option within the
2158   <xref target="header.connection" format="none">Connection</xref> header field (<xref target="header.connection"/>)
2159   in order to prevent the TE field from being forwarded by intermediaries
2160   that do not support its semantics.
2164<section title="Trailer" anchor="header.trailer">
2165  <iref primary="true" item="Trailer header field"/>
2168   When a message includes a message body encoded with the chunked
2169   transfer coding and the sender desires to send metadata in the form of
2170   trailer fields at the end of the message, the sender SHOULD generate a
2171   <xref target="header.trailer" format="none">Trailer</xref> header field before the message body to indicate
2172   which fields will be present in the trailers. This allows the recipient
2173   to prepare for receipt of that metadata before it starts processing the body,
2174   which is useful if the message is being streamed and the recipient wishes
2175   to confirm an integrity check on the fly.
2177<figure><iref primary="true" item="Grammar" subitem="Trailer"/><iref primary="false" item="Grammar" subitem="field-name"/><artwork type="abnf2616"><![CDATA[
2178  Trailer = 1#field-name
2183<section title="Message Routing" anchor="message.routing">
2185   HTTP request message routing is determined by each client based on the
2186   target resource, the client's proxy configuration, and
2187   establishment or reuse of an inbound connection.  The corresponding
2188   response routing follows the same connection chain back to the client.
2191<section title="Identifying a Target Resource" anchor="target-resource">
2192  <iref primary="true" item="target resource"/>
2193  <iref primary="true" item="target URI"/>
2197   HTTP is used in a wide variety of applications, ranging from
2198   general-purpose computers to home appliances.  In some cases,
2199   communication options are hard-coded in a client's configuration.
2200   However, most HTTP clients rely on the same resource identification
2201   mechanism and configuration techniques as general-purpose Web browsers.
2204   HTTP communication is initiated by a user agent for some purpose.
2205   The purpose is a combination of request semantics, which are defined in
2206   <xref target="Part2"/>, and a target resource upon which to apply those
2207   semantics.  A URI reference (<xref target="uri"/>) is typically used as
2208   an identifier for the "target resource", which a user agent
2209   would resolve to its absolute form in order to obtain the
2210   "target URI".  The target URI
2211   excludes the reference's fragment component, if any,
2212   since fragment identifiers are reserved for client-side processing
2213   (<xref target="RFC3986"/>, Section 3.5).
2217<section title="Connecting Inbound" anchor="connecting.inbound">
2219   Once the target URI is determined, a client needs to decide whether
2220   a network request is necessary to accomplish the desired semantics and,
2221   if so, where that request is to be directed.
2224   If the client has a cache <xref target="Part6"/> and the request can be
2225   satisfied by it, then the request is
2226   usually directed there first.
2229   If the request is not satisfied by a cache, then a typical client will
2230   check its configuration to determine whether a proxy is to be used to
2231   satisfy the request.  Proxy configuration is implementation-dependent,
2232   but is often based on URI prefix matching, selective authority matching,
2233   or both, and the proxy itself is usually identified by an "http" or
2234   "https" URI.  If a proxy is applicable, the client connects inbound by
2235   establishing (or reusing) a connection to that proxy.
2238   If no proxy is applicable, a typical client will invoke a handler routine,
2239   usually specific to the target URI's scheme, to connect directly
2240   to an authority for the target resource.  How that is accomplished is
2241   dependent on the target URI scheme and defined by its associated
2242   specification, similar to how this specification defines origin server
2243   access for resolution of the "http" (<xref target="http.uri"/>) and
2244   "https" (<xref target="https.uri"/>) schemes.
2247   HTTP requirements regarding connection management are defined in
2248   <xref target=""/>.
2252<section title="Request Target" anchor="request-target">
2254   Once an inbound connection is obtained,
2255   the client sends an HTTP request message (<xref target="http.message"/>)
2256   with a request-target derived from the target URI.
2257   There are four distinct formats for the request-target, depending on both
2258   the method being requested and whether the request is to a proxy.
2260<figure><iref primary="true" item="Grammar" subitem="request-target"/><iref primary="false" item="Grammar" subitem="origin-form"/><iref primary="false" item="Grammar" subitem="absolute-form"/><iref primary="false" item="Grammar" subitem="authority-form"/><iref primary="false" item="Grammar" subitem="asterisk-form"/><artwork type="abnf2616"><![CDATA[
2261  request-target = origin-form
2262                 / absolute-form
2263                 / authority-form
2264                 / asterisk-form
2267<section title="origin-form" anchor="origin-form">
2268   <iref item="origin-form (of request-target)"/>
2270   The most common form of request-target is the origin-form.
2272<figure><iref primary="true" item="Grammar" subitem="origin-form"/><artwork type="abnf2616"><![CDATA[
2273  origin-form    = absolute-path [ "?" query ]
2276   When making a request directly to an origin server, other than a CONNECT
2277   or server-wide OPTIONS request (as detailed below),
2278   a client MUST send only the absolute path and query components of
2279   the target URI as the request-target.
2280   If the target URI's path component is empty, the client MUST send
2281   "/" as the path within the origin-form of request-target.
2282   A <xref target="" format="none">Host</xref> header field is also sent, as defined in
2283   <xref target=""/>.
2286   For example, a client wishing to retrieve a representation of the resource
2287   identified as
2289<figure><artwork type="example"><![CDATA[
2291  ]]></artwork></figure>
2293   directly from the origin server would open (or reuse) a TCP connection
2294   to port 80 of the host "" and send the lines:
2296<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2297  GET /where?q=now HTTP/1.1
2298  Host:
2299  ]]></artwork></figure>
2301   followed by the remainder of the request message.
2305<section title="absolute-form" anchor="absolute-form">
2306   <iref item="absolute-form (of request-target)"/>
2308   When making a request to a proxy, other than a CONNECT or server-wide
2309   OPTIONS request (as detailed below), a client MUST send the target URI
2310   in absolute-form as the request-target.
2312<figure><iref primary="true" item="Grammar" subitem="absolute-form"/><artwork type="abnf2616"><![CDATA[
2313  absolute-form  = absolute-URI
2316   The proxy is requested to either service that request from a valid cache,
2317   if possible, or make the same request on the client's behalf to either
2318   the next inbound proxy server or directly to the origin server indicated
2319   by the request-target.  Requirements on such "forwarding" of messages are
2320   defined in <xref target="message.forwarding"/>.
2323   An example absolute-form of request-line would be:
2325<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2326  GET HTTP/1.1
2327  ]]></artwork></figure>
2329   To allow for transition to the absolute-form for all requests in some
2330   future version of HTTP, a server MUST accept the absolute-form
2331   in requests, even though HTTP/1.1 clients will only send them in requests
2332   to proxies.
2336<section title="authority-form" anchor="authority-form">
2337   <iref item="authority-form (of request-target)"/>
2339   The authority-form of request-target is only used for
2340   CONNECT requests (Section 4.3.6 of <xref target="Part2"/>).
2342<figure><iref primary="true" item="Grammar" subitem="authority-form"/><artwork type="abnf2616"><![CDATA[
2343  authority-form = authority
2346   When making a CONNECT request to establish a
2347   tunnel through one or more proxies, a client MUST send only the target
2348   URI's authority component (excluding any userinfo and its "@" delimiter) as
2349   the request-target. For example,
2351<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2352  CONNECT HTTP/1.1
2353  ]]></artwork></figure>
2356<section title="asterisk-form" anchor="asterisk-form">
2357   <iref item="asterisk-form (of request-target)"/>
2359   The asterisk-form of request-target is only used for a server-wide
2360   OPTIONS request (Section 4.3.7 of <xref target="Part2"/>).
2362<figure><iref primary="true" item="Grammar" subitem="asterisk-form"/><artwork type="abnf2616"><![CDATA[
2363  asterisk-form  = "*"
2366   When a client wishes to request OPTIONS
2367   for the server as a whole, as opposed to a specific named resource of
2368   that server, the client MUST send only "*" (%x2A) as the request-target.
2369   For example,
2371<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2372  OPTIONS * HTTP/1.1
2373  ]]></artwork></figure>
2375   If a proxy receives an OPTIONS request with an absolute-form of
2376   request-target in which the URI has an empty path and no query component,
2377   then the last proxy on the request chain MUST send a request-target
2378   of "*" when it forwards the request to the indicated origin server.
2381   For example, the request
2382</preamble><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2383  OPTIONS HTTP/1.1
2384  ]]></artwork></figure>
2386  would be forwarded by the final proxy as
2387</preamble><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2388  OPTIONS * HTTP/1.1
2389  Host:
2390  ]]></artwork>
2392   after connecting to port 8001 of host "".
2398<section title="Host" anchor="">
2399  <iref primary="true" item="Host header field"/>
2402   The "Host" header field in a request provides the host and port
2403   information from the target URI, enabling the origin
2404   server to distinguish among resources while servicing requests
2405   for multiple host names on a single IP address.
2407<figure><iref primary="true" item="Grammar" subitem="Host"/><artwork type="abnf2616"><![CDATA[
2408  Host = uri-host [ ":" port ] ; Section 2.7.1
2411   A client MUST send a Host header field in all HTTP/1.1 request messages.
2412   If the target URI includes an authority component, then a client MUST
2413   send a field-value for Host that is identical to that authority
2414   component, excluding any userinfo subcomponent and its "@" delimiter
2415   (<xref target="http.uri"/>).
2416   If the authority component is missing or undefined for the target URI,
2417   then a client MUST send a Host header field with an empty field-value.
2420   Since the Host field-value is critical information for handling a request,
2421   a user agent SHOULD generate Host as the first header field following the
2422   request-line.
2425   For example, a GET request to the origin server for
2426   &lt;; would begin with:
2428<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2429  GET /pub/WWW/ HTTP/1.1
2430  Host:
2431  ]]></artwork></figure>
2433   A client MUST send a Host header field in an HTTP/1.1 request even
2434   if the request-target is in the absolute-form, since this
2435   allows the Host information to be forwarded through ancient HTTP/1.0
2436   proxies that might not have implemented Host.
2439   When a proxy receives a request with an absolute-form of
2440   request-target, the proxy MUST ignore the received
2441   Host header field (if any) and instead replace it with the host
2442   information of the request-target.  A proxy that forwards such a request
2443   MUST generate a new Host field-value based on the received
2444   request-target rather than forward the received Host field-value.
2447   Since the Host header field acts as an application-level routing
2448   mechanism, it is a frequent target for malware seeking to poison
2449   a shared cache or redirect a request to an unintended server.
2450   An interception proxy is particularly vulnerable if it relies on
2451   the Host field-value for redirecting requests to internal
2452   servers, or for use as a cache key in a shared cache, without
2453   first verifying that the intercepted connection is targeting a
2454   valid IP address for that host.
2457   A server MUST respond with a 400 (Bad Request) status code
2458   to any HTTP/1.1 request message that lacks a Host header field and
2459   to any request message that contains more than one Host header field
2460   or a Host header field with an invalid field-value.
2464<section title="Effective Request URI" anchor="effective.request.uri">
2465  <iref primary="true" item="effective request URI"/>
2468   Since the request-target often contains only part of the user agent's
2469   target URI, a server reconstructs the intended target as an
2470   "effective request URI" to properly service the request.
2471   This reconstruction involves both the server's local configuration and
2472   information communicated in the <xref target="request-target" format="none">request-target</xref>,
2473   <xref target="" format="none">Host</xref> header field, and connection context.
2476   For a user agent, the effective request URI is the target URI.
2479   If the <xref target="request-target" format="none">request-target</xref> is in <xref target="absolute-form" format="none">absolute-form</xref>,
2480   the effective request URI is the same as the request-target. Otherwise, the
2481   effective request URI is constructed as follows:
2482<list style="empty">
2484   If the server's configuration (or outbound gateway) provides a fixed URI
2485   <xref target="uri" format="none">scheme</xref>, that scheme is used for the effective request URI.
2486   Otherwise, if the request is received over a TLS-secured TCP connection,
2487   the effective request URI's scheme is "https"; if not, the scheme is "http".
2490   If the server's configuration (or outbound gateway) provides a fixed URI
2491   <xref target="uri" format="none">authority</xref> component, that authority is used for the
2492   effective request URI. If not, then if the request-target is in
2493   <xref target="authority-form" format="none">authority-form</xref>, the effective request URI's authority
2494   component is the same as the request-target.
2495   If not, then if a <xref target="" format="none">Host</xref> header field is supplied with a
2496   non-empty field-value, the authority component is the same as the
2497   Host field-value. Otherwise, the authority component is assigned
2498   the default name configured for the server and, if the connection's
2499   incoming TCP port number differs from the default port for the effective
2500   request URI's scheme, then a colon (":") and the incoming port number (in
2501   decimal form) are appended to the authority component.
2504   If the request-target is in <xref target="authority-form" format="none">authority-form</xref> or
2505   <xref target="asterisk-form" format="none">asterisk-form</xref>, the effective request URI's combined
2506   <xref target="uri" format="none">path</xref> and <xref target="uri" format="none">query</xref> component is empty. Otherwise,
2507   the combined <xref target="uri" format="none">path</xref> and <xref target="uri" format="none">query</xref> component is the
2508   same as the request-target.
2511   The components of the effective request URI, once determined as above, can
2512   be combined into <xref target="uri" format="none">absolute-URI</xref> form by concatenating the
2513   scheme, "://", authority, and combined path and query component.
2519   Example 1: the following message received over an insecure TCP connection
2521<artwork type="example"><![CDATA[
2522  GET /pub/WWW/TheProject.html HTTP/1.1
2523  Host:
2524  ]]></artwork>
2528  has an effective request URI of
2530<artwork type="example"><![CDATA[
2532  ]]></artwork>
2536   Example 2: the following message received over a TLS-secured TCP connection
2538<artwork type="example"><![CDATA[
2539  OPTIONS * HTTP/1.1
2540  Host:
2541  ]]></artwork>
2545  has an effective request URI of
2547<artwork type="example"><![CDATA[
2549  ]]></artwork>
2552   Recipients of an HTTP/1.0 request that lacks a <xref target="" format="none">Host</xref> header
2553   field might need to use heuristics (e.g., examination of the URI path for
2554   something unique to a particular host) in order to guess the
2555   effective request URI's authority component.
2558   Once the effective request URI has been constructed, an origin server needs
2559   to decide whether or not to provide service for that URI via the connection
2560   in which the request was received. For example, the request might have been
2561   misdirected, deliberately or accidentally, such that the information within
2562   a received <xref target="request-target" format="none">request-target</xref> or <xref target="" format="none">Host</xref> header
2563   field differs from the host or port upon which the connection has been
2564   made. If the connection is from a trusted gateway, that inconsistency might
2565   be expected; otherwise, it might indicate an attempt to bypass security
2566   filters, trick the server into delivering non-public content, or poison a
2567   cache. See <xref target="security.considerations"/> for security
2568   considerations regarding message routing.
2572<section title="Associating a Response to a Request" anchor="">
2574   HTTP does not include a request identifier for associating a given
2575   request message with its corresponding one or more response messages.
2576   Hence, it relies on the order of response arrival to correspond exactly
2577   to the order in which requests are made on the same connection.
2578   More than one response message per request only occurs when one or more
2579   informational responses (1xx, see Section 6.2 of <xref target="Part2"/>) precede a
2580   final response to the same request.
2583   A client that has more than one outstanding request on a connection MUST
2584   maintain a list of outstanding requests in the order sent and MUST
2585   associate each received response message on that connection to the highest
2586   ordered request that has not yet received a final (non-1xx)
2587   response.
2591<section title="Message Forwarding" anchor="message.forwarding">
2593   As described in <xref target="intermediaries"/>, intermediaries can serve
2594   a variety of roles in the processing of HTTP requests and responses.
2595   Some intermediaries are used to improve performance or availability.
2596   Others are used for access control or to filter content.
2597   Since an HTTP stream has characteristics similar to a pipe-and-filter
2598   architecture, there are no inherent limits to the extent an intermediary
2599   can enhance (or interfere) with either direction of the stream.
2602   An intermediary not acting as a tunnel MUST implement the
2603   <xref target="header.connection" format="none">Connection</xref> header field, as specified in
2604   <xref target="header.connection"/>, and exclude fields from being forwarded
2605   that are only intended for the incoming connection.
2608   An intermediary MUST NOT forward a message to itself unless it is
2609   protected from an infinite request loop. In general, an intermediary ought
2610   to recognize its own server names, including any aliases, local variations,
2611   or literal IP addresses, and respond to such requests directly.
2614<section title="Via" anchor="header.via">
2615  <iref primary="true" item="Via header field"/>
2621   The "Via" header field indicates the presence of intermediate protocols and
2622   recipients between the user agent and the server (on requests) or between
2623   the origin server and the client (on responses), similar to the
2624   "Received" header field in email
2625   (Section 3.6.7 of <xref target="RFC5322"/>).
2626   Via can be used for tracking message forwards,
2627   avoiding request loops, and identifying the protocol capabilities of
2628   senders along the request/response chain.
2630<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[
2631  Via = 1#( received-protocol RWS received-by [ RWS comment ] )
2633  received-protocol = [ protocol-name "/" ] protocol-version
2634                      ; see Section 6.7
2635  received-by       = ( uri-host [ ":" port ] ) / pseudonym
2636  pseudonym         = token
2639   Multiple Via field values represent each proxy or gateway that has
2640   forwarded the message. Each intermediary appends its own information
2641   about how the message was received, such that the end result is ordered
2642   according to the sequence of forwarding recipients.
2645   A proxy MUST send an appropriate Via header field, as described below, in
2646   each message that it forwards.
2647   An HTTP-to-HTTP gateway MUST send an appropriate Via header field in
2648   each inbound request message and MAY send a Via header field in
2649   forwarded response messages.
2652   For each intermediary, the received-protocol indicates the protocol and
2653   protocol version used by the upstream sender of the message. Hence, the
2654   Via field value records the advertised protocol capabilities of the
2655   request/response chain such that they remain visible to downstream
2656   recipients; this can be useful for determining what backwards-incompatible
2657   features might be safe to use in response, or within a later request, as
2658   described in <xref target="http.version"/>. For brevity, the protocol-name
2659   is omitted when the received protocol is HTTP.
2662   The received-by portion of the field value is normally the host and optional
2663   port number of a recipient server or client that subsequently forwarded the
2664   message.
2665   However, if the real host is considered to be sensitive information, a
2666   sender MAY replace it with a pseudonym. If a port is not provided,
2667   a recipient MAY interpret that as meaning it was received on the default
2668   TCP port, if any, for the received-protocol.
2671   A sender MAY generate comments in the Via header field to identify the
2672   software of each recipient, analogous to the User-Agent and
2673   Server header fields. However, all comments in the Via field
2674   are optional and a recipient MAY remove them prior to forwarding the
2675   message.
2678   For example, a request message could be sent from an HTTP/1.0 user
2679   agent to an internal proxy code-named "fred", which uses HTTP/1.1 to
2680   forward the request to a public proxy at, which completes
2681   the request by forwarding it to the origin server at
2682   The request received by would then have the following
2683   Via header field:
2685<figure><artwork type="example"><![CDATA[
2686  Via: 1.0 fred, 1.1
2689   An intermediary used as a portal through a network firewall
2690   SHOULD NOT forward the names and ports of hosts within the firewall
2691   region unless it is explicitly enabled to do so. If not enabled, such an
2692   intermediary SHOULD replace each received-by host of any host behind the
2693   firewall by an appropriate pseudonym for that host.
2696   An intermediary MAY combine an ordered subsequence of Via header
2697   field entries into a single such entry if the entries have identical
2698   received-protocol values. For example,
2700<figure><artwork type="example"><![CDATA[
2701  Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy
2704  could be collapsed to
2706<figure><artwork type="example"><![CDATA[
2707  Via: 1.0 ricky, 1.1 mertz, 1.0 lucy
2710   A sender SHOULD NOT combine multiple entries unless they are all
2711   under the same organizational control and the hosts have already been
2712   replaced by pseudonyms. A sender MUST NOT combine entries that
2713   have different received-protocol values.
2717<section title="Transformations" anchor="message.transformations">
2718   <iref primary="true" item="transforming proxy"/>
2719   <iref primary="true" item="non-transforming proxy"/>
2721   Some intermediaries include features for transforming messages and their
2722   payloads. A proxy might, for example, convert between image formats in
2723   order to save cache space or to reduce the amount of traffic on a slow
2724   link. However, operational problems might occur when these transformations
2725   are applied to payloads intended for critical applications, such as medical
2726   imaging or scientific data analysis, particularly when integrity checks or
2727   digital signatures are used to ensure that the payload received is
2728   identical to the original.
2731   An HTTP-to-HTTP proxy is called a "transforming proxy"
2732   if it is designed or configured to modify messages in a semantically
2733   meaningful way (i.e., modifications, beyond those required by normal
2734   HTTP processing, that change the message in a way that would be
2735   significant to the original sender or potentially significant to
2736   downstream recipients).  For example, a transforming proxy might be
2737   acting as a shared annotation server (modifying responses to include
2738   references to a local annotation database), a malware filter, a
2739   format transcoder, or a privacy filter. Such transformations are presumed
2740   to be desired by whichever client (or client organization) selected the
2741   proxy.
2744   If a proxy receives a request-target with a host name that is not a
2745   fully qualified domain name, it MAY add its own domain to the host name
2746   it received when forwarding the request.  A proxy MUST NOT change the
2747   host name if the request-target contains a fully qualified domain name.
2750   A proxy MUST NOT modify the "absolute-path" and "query" parts of the
2751   received request-target when forwarding it to the next inbound server,
2752   except as noted above to replace an empty path with "/" or "*".
2755   A proxy MAY modify the message body through application
2756   or removal of a transfer coding (<xref target="transfer.codings"/>).
2759   A proxy MUST NOT transform the payload (Section 3.3 of <xref target="Part2"/>) of a message that
2760   contains a no-transform cache-control directive (Section 5.2 of <xref target="Part6"/>).
2763   A proxy MAY transform the payload of a message
2764   that does not contain a no-transform cache-control directive.
2765   A proxy that transforms a payload MUST add a Warning
2766   header field with the warn-code of 214 ("Transformation Applied")
2767   if one is not already in the message (see Section 5.5 of <xref target="Part6"/>).
2768   A proxy that transforms the payload of a 200 (OK) response
2769   can further inform downstream recipients that a transformation has been
2770   applied by changing the response status code to
2771   203 (Non-Authoritative Information) (Section 6.3.4 of <xref target="Part2"/>).
2774   A proxy SHOULD NOT modify header fields that provide information about
2775   the end points of the communication chain, the resource state, or the
2776   selected representation (other than the payload) unless the field's
2777   definition specifically allows such modification or the modification is
2778   deemed necessary for privacy or security.
2784<section title="Connection Management" anchor="">
2786   HTTP messaging is independent of the underlying transport or
2787   session-layer connection protocol(s).  HTTP only presumes a reliable
2788   transport with in-order delivery of requests and the corresponding
2789   in-order delivery of responses.  The mapping of HTTP request and
2790   response structures onto the data units of an underlying transport
2791   protocol is outside the scope of this specification.
2794   As described in <xref target="connecting.inbound"/>, the specific
2795   connection protocols to be used for an HTTP interaction are determined by
2796   client configuration and the <xref target="target-resource" format="none">target URI</xref>.
2797   For example, the "http" URI scheme
2798   (<xref target="http.uri"/>) indicates a default connection of TCP
2799   over IP, with a default TCP port of 80, but the client might be
2800   configured to use a proxy via some other connection, port, or protocol.
2803   HTTP implementations are expected to engage in connection management,
2804   which includes maintaining the state of current connections,
2805   establishing a new connection or reusing an existing connection,
2806   processing messages received on a connection, detecting connection
2807   failures, and closing each connection.
2808   Most clients maintain multiple connections in parallel, including
2809   more than one connection per server endpoint.
2810   Most servers are designed to maintain thousands of concurrent connections,
2811   while controlling request queues to enable fair use and detect
2812   denial of service attacks.
2815<section title="Connection" anchor="header.connection">
2816  <iref primary="true" item="Connection header field"/>
2817  <iref primary="true" item="close"/>
2822   The "Connection" header field allows the sender to indicate desired
2823   control options for the current connection.  In order to avoid confusing
2824   downstream recipients, a proxy or gateway MUST remove or replace any
2825   received connection options before forwarding the message.
2828   When a header field aside from Connection is used to supply control
2829   information for or about the current connection, the sender MUST list
2830   the corresponding field-name within the "Connection" header field.
2831   A proxy or gateway MUST parse a received Connection
2832   header field before a message is forwarded and, for each
2833   connection-option in this field, remove any header field(s) from
2834   the message with the same name as the connection-option, and then
2835   remove the Connection header field itself (or replace it with the
2836   intermediary's own connection options for the forwarded message).
2839   Hence, the Connection header field provides a declarative way of
2840   distinguishing header fields that are only intended for the
2841   immediate recipient ("hop-by-hop") from those fields that are
2842   intended for all recipients on the chain ("end-to-end"), enabling the
2843   message to be self-descriptive and allowing future connection-specific
2844   extensions to be deployed without fear that they will be blindly
2845   forwarded by older intermediaries.
2848   The Connection header field's value has the following grammar:
2850<figure><iref primary="true" item="Grammar" subitem="Connection"/><iref primary="true" item="Grammar" subitem="connection-option"/><artwork type="abnf2616"><![CDATA[
2851  Connection        = 1#connection-option
2852  connection-option = token
2855   Connection options are case-insensitive.
2858   A sender MUST NOT send a connection option corresponding to a header
2859   field that is intended for all recipients of the payload.
2860   For example, Cache-Control is never appropriate as a
2861   connection option (Section 5.2 of <xref target="Part6"/>).
2864   The connection options do not always correspond to a header field
2865   present in the message, since a connection-specific header field
2866   might not be needed if there are no parameters associated with a
2867   connection option. In contrast, a connection-specific header field that
2868   is received without a corresponding connection option usually indicates
2869   that the field has been improperly forwarded by an intermediary and
2870   ought to be ignored by the recipient.
2873   When defining new connection options, specification authors ought to survey
2874   existing header field names and ensure that the new connection option does
2875   not share the same name as an already deployed header field.
2876   Defining a new connection option essentially reserves that potential
2877   field-name for carrying additional information related to the
2878   connection option, since it would be unwise for senders to use
2879   that field-name for anything else.
2882   The "close" connection option is defined for a
2883   sender to signal that this connection will be closed after completion of
2884   the response. For example,
2886<figure><artwork type="example"><![CDATA[
2887  Connection: close
2890   in either the request or the response header fields indicates that the
2891   sender is going to close the connection after the current request/response
2892   is complete (<xref target="persistent.tear-down"/>).
2895   A client that does not support <xref target="persistent.connections" format="none">persistent connections</xref> MUST
2896   send the "close" connection option in every request message.
2899   A server that does not support <xref target="persistent.connections" format="none">persistent connections</xref> MUST
2900   send the "close" connection option in every response message that
2901   does not have a 1xx (Informational) status code.
2905<section title="Establishment" anchor="persistent.establishment">
2907   It is beyond the scope of this specification to describe how connections
2908   are established via various transport or session-layer protocols.
2909   Each connection applies to only one transport link.
2913<section title="Persistence" anchor="persistent.connections">
2916   HTTP/1.1 defaults to the use of "persistent connections",
2917   allowing multiple requests and responses to be carried over a single
2918   connection. The "<xref target="header.connection" format="none">close</xref>" connection-option is used to signal
2919   that a connection will not persist after the current request/response.
2920   HTTP implementations SHOULD support persistent connections.
2923   A recipient determines whether a connection is persistent or not based on
2924   the most recently received message's protocol version and
2925   <xref target="header.connection" format="none">Connection</xref> header field (if any):
2926   <list style="symbols">
2927     <t>If the <xref target="header.connection" format="none">close</xref> connection option is present, the
2928        connection will not persist after the current response; else,</t>
2929     <t>If the received protocol is HTTP/1.1 (or later), the connection will
2930        persist after the current response; else,</t>
2931     <t>If the received protocol is HTTP/1.0, the "keep-alive"
2932        connection option is present, the recipient is not a proxy, and
2933        the recipient wishes to honor the HTTP/1.0 "keep-alive" mechanism,
2934        the connection will persist after the current response; otherwise,</t>
2935     <t>The connection will close after the current response.</t>
2936   </list>
2939   A client MAY send additional requests on a persistent connection until it
2940   sends or receives a <xref target="header.connection" format="none">close</xref> connection option or receives an
2941   HTTP/1.0 response without a "keep-alive" connection option.
2944   In order to remain persistent, all messages on a connection need to
2945   have a self-defined message length (i.e., one not defined by closure
2946   of the connection), as described in <xref target="message.body"/>.
2947   A server MUST read the entire request message body or close
2948   the connection after sending its response, since otherwise the
2949   remaining data on a persistent connection would be misinterpreted
2950   as the next request.  Likewise,
2951   a client MUST read the entire response message body if it intends
2952   to reuse the same connection for a subsequent request.
2955   A proxy server MUST NOT maintain a persistent connection with an
2956   HTTP/1.0 client (see Section 19.7.1 of <xref target="RFC2068"/> for
2957   information and discussion of the problems with the Keep-Alive header field
2958   implemented by many HTTP/1.0 clients).
2961   See <xref target="compatibility.with.http.1.0.persistent.connections"/>
2962   for more information on backward compatibility with HTTP/1.0 clients.
2965<section title="Retrying Requests" anchor="persistent.retrying.requests">
2967   Connections can be closed at any time, with or without intention.
2968   Implementations ought to anticipate the need to recover
2969   from asynchronous close events.
2972   When an inbound connection is closed prematurely, a client MAY open a new
2973   connection and automatically retransmit an aborted sequence of requests if
2974   all of those requests have idempotent methods (Section 4.2.2 of <xref target="Part2"/>).
2975   A proxy MUST NOT automatically retry non-idempotent requests.
2978   A user agent MUST NOT automatically retry a request with a non-idempotent
2979   method unless it has some means to know that the request semantics are
2980   actually idempotent, regardless of the method, or some means to detect that
2981   the original request was never applied. For example, a user agent that
2982   knows (through design or configuration) that a POST request to a given
2983   resource is safe can repeat that request automatically.
2984   Likewise, a user agent designed specifically to operate on a version
2985   control repository might be able to recover from partial failure conditions
2986   by checking the target resource revision(s) after a failed connection,
2987   reverting or fixing any changes that were partially applied, and then
2988   automatically retrying the requests that failed.
2991   A client SHOULD NOT automatically retry a failed automatic retry.
2995<section title="Pipelining" anchor="pipelining">
2998   A client that supports persistent connections MAY "pipeline"
2999   its requests (i.e., send multiple requests without waiting for each
3000   response). A server MAY process a sequence of pipelined requests in
3001   parallel if they all have safe methods (Section 4.2.1 of <xref target="Part2"/>), but MUST send
3002   the corresponding responses in the same order that the requests were
3003   received.
3006   A client that pipelines requests SHOULD retry unanswered requests if the
3007   connection closes before it receives all of the corresponding responses.
3008   When retrying pipelined requests after a failed connection (a connection
3009   not explicitly closed by the server in its last complete response), a
3010   client MUST NOT pipeline immediately after connection establishment,
3011   since the first remaining request in the prior pipeline might have caused
3012   an error response that can be lost again if multiple requests are sent on a
3013   prematurely closed connection (see the TCP reset problem described in
3014   <xref target="persistent.tear-down"/>).
3017   Idempotent methods (Section 4.2.2 of <xref target="Part2"/>) are significant to pipelining
3018   because they can be automatically retried after a connection failure.
3019   A user agent SHOULD NOT pipeline requests after a non-idempotent method,
3020   until the final response status code for that method has been received,
3021   unless the user agent has a means to detect and recover from partial
3022   failure conditions involving the pipelined sequence.
3025   An intermediary that receives pipelined requests MAY pipeline those
3026   requests when forwarding them inbound, since it can rely on the outbound
3027   user agent(s) to determine what requests can be safely pipelined. If the
3028   inbound connection fails before receiving a response, the pipelining
3029   intermediary MAY attempt to retry a sequence of requests that have yet
3030   to receive a response if the requests all have idempotent methods;
3031   otherwise, the pipelining intermediary SHOULD forward any received
3032   responses and then close the corresponding outbound connection(s) so that
3033   the outbound user agent(s) can recover accordingly.
3038<section title="Concurrency" anchor="persistent.concurrency">
3040   A client ought to limit the number of simultaneous open
3041   connections that it maintains to a given server.
3044   Previous revisions of HTTP gave a specific number of connections as a
3045   ceiling, but this was found to be impractical for many applications. As a
3046   result, this specification does not mandate a particular maximum number of
3047   connections, but instead encourages clients to be conservative when opening
3048   multiple connections.
3051   Multiple connections are typically used to avoid the "head-of-line
3052   blocking" problem, wherein a request that takes significant server-side
3053   processing and/or has a large payload blocks subsequent requests on the
3054   same connection. However, each connection consumes server resources.
3055   Furthermore, using multiple connections can cause undesirable side effects
3056   in congested networks.
3059   Note that a server might reject traffic that it deems abusive or
3060   characteristic of a denial of service attack, such as an excessive number
3061   of open connections from a single client.
3065<section title="Failures and Time-outs" anchor="persistent.failures">
3067   Servers will usually have some time-out value beyond which they will
3068   no longer maintain an inactive connection. Proxy servers might make
3069   this a higher value since it is likely that the client will be making
3070   more connections through the same proxy server. The use of persistent
3071   connections places no requirements on the length (or existence) of
3072   this time-out for either the client or the server.
3075   A client or server that wishes to time-out SHOULD issue a graceful close
3076   on the connection. Implementations SHOULD constantly monitor open
3077   connections for a received closure signal and respond to it as appropriate,
3078   since prompt closure of both sides of a connection enables allocated system
3079   resources to be reclaimed.
3082   A client, server, or proxy MAY close the transport connection at any
3083   time. For example, a client might have started to send a new request
3084   at the same time that the server has decided to close the "idle"
3085   connection. From the server's point of view, the connection is being
3086   closed while it was idle, but from the client's point of view, a
3087   request is in progress.
3090   A server SHOULD sustain persistent connections, when possible, and allow
3091   the underlying
3092   transport's flow control mechanisms to resolve temporary overloads, rather
3093   than terminate connections with the expectation that clients will retry.
3094   The latter technique can exacerbate network congestion.
3097   A client sending a message body SHOULD monitor
3098   the network connection for an error response while it is transmitting
3099   the request. If the client sees a response that indicates the server does
3100   not wish to receive the message body and is closing the connection, the
3101   client SHOULD immediately cease transmitting the body and close its side
3102   of the connection.
3106<section title="Tear-down" anchor="persistent.tear-down">
3107  <iref primary="false" item="Connection header field"/>
3108  <iref primary="false" item="close"/>
3110   The <xref target="header.connection" format="none">Connection</xref> header field
3111   (<xref target="header.connection"/>) provides a "<xref target="header.connection" format="none">close</xref>"
3112   connection option that a sender SHOULD send when it wishes to close
3113   the connection after the current request/response pair.
3116   A client that sends a <xref target="header.connection" format="none">close</xref> connection option MUST NOT
3117   send further requests on that connection (after the one containing
3118   <xref target="header.connection" format="none">close</xref>) and MUST close the connection after reading the
3119   final response message corresponding to this request.
3122   A server that receives a <xref target="header.connection" format="none">close</xref> connection option MUST
3123   initiate a close of the connection (see below) after it sends the
3124   final response to the request that contained <xref target="header.connection" format="none">close</xref>.
3125   The server SHOULD send a <xref target="header.connection" format="none">close</xref> connection option
3126   in its final response on that connection. The server MUST NOT process
3127   any further requests received on that connection.
3130   A server that sends a <xref target="header.connection" format="none">close</xref> connection option MUST
3131   initiate a close of the connection (see below) after it sends the
3132   response containing <xref target="header.connection" format="none">close</xref>. The server MUST NOT process
3133   any further requests received on that connection.
3136   A client that receives a <xref target="header.connection" format="none">close</xref> connection option MUST
3137   cease sending requests on that connection and close the connection
3138   after reading the response message containing the close; if additional
3139   pipelined requests had been sent on the connection, the client SHOULD NOT
3140   assume that they will be processed by the server.
3143   If a server performs an immediate close of a TCP connection, there is a
3144   significant risk that the client will not be able to read the last HTTP
3145   response.  If the server receives additional data from the client on a
3146   fully-closed connection, such as another request that was sent by the
3147   client before receiving the server's response, the server's TCP stack will
3148   send a reset packet to the client; unfortunately, the reset packet might
3149   erase the client's unacknowledged input buffers before they can be read
3150   and interpreted by the client's HTTP parser.
3153   To avoid the TCP reset problem, servers typically close a connection in
3154   stages. First, the server performs a half-close by closing only the write
3155   side of the read/write connection. The server then continues to read from
3156   the connection until it receives a corresponding close by the client, or
3157   until the server is reasonably certain that its own TCP stack has received
3158   the client's acknowledgement of the packet(s) containing the server's last
3159   response. Finally, the server fully closes the connection.
3162   It is unknown whether the reset problem is exclusive to TCP or might also
3163   be found in other transport connection protocols.
3167<section title="Upgrade" anchor="header.upgrade">
3168  <iref primary="true" item="Upgrade header field"/>
3174   The "Upgrade" header field is intended to provide a simple mechanism
3175   for transitioning from HTTP/1.1 to some other protocol on the same
3176   connection.  A client MAY send a list of protocols in the Upgrade
3177   header field of a request to invite the server to switch to one or
3178   more of those protocols, in order of descending preference, before sending
3179   the final response. A server MAY ignore a received Upgrade header field
3180   if it wishes to continue using the current protocol on that connection.
3181   Upgrade cannot be used to insist on a protocol change.
3183<figure><iref primary="true" item="Grammar" subitem="Upgrade"/><artwork type="abnf2616"><![CDATA[
3184  Upgrade          = 1#protocol
3186  protocol         = protocol-name ["/" protocol-version]
3187  protocol-name    = token
3188  protocol-version = token
3191   A server that sends a 101 (Switching Protocols) response
3192   MUST send an Upgrade header field to indicate the new protocol(s) to
3193   which the connection is being switched; if multiple protocol layers are
3194   being switched, the sender MUST list the protocols in layer-ascending
3195   order. A server MUST NOT switch to a protocol that was not indicated by
3196   the client in the corresponding request's Upgrade header field.
3197   A server MAY choose to ignore the order of preference indicated by the
3198   client and select the new protocol(s) based on other factors, such as the
3199   nature of the request or the current load on the server.
3202   A server that sends a 426 (Upgrade Required) response
3203   MUST send an Upgrade header field to indicate the acceptable protocols,
3204   in order of descending preference.
3207   A server MAY send an Upgrade header field in any other response to
3208   advertise that it implements support for upgrading to the listed protocols,
3209   in order of descending preference, when appropriate for a future request.
3212   The following is a hypothetical example sent by a client:
3213</preamble><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
3214  GET /hello.txt HTTP/1.1
3215  Host:
3216  Connection: upgrade
3217  Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
3219  ]]></artwork></figure>
3221   The capabilities and nature of the
3222   application-level communication after the protocol change is entirely
3223   dependent upon the new protocol(s) chosen. However, immediately after
3224   sending the 101 response, the server is expected to continue responding to
3225   the original request as if it had received its equivalent within the new
3226   protocol (i.e., the server still has an outstanding request to satisfy
3227   after the protocol has been changed, and is expected to do so without
3228   requiring the request to be repeated).
3231   For example, if the Upgrade header field is received in a GET request
3232   and the server decides to switch protocols, it first responds
3233   with a 101 (Switching Protocols) message in HTTP/1.1 and
3234   then immediately follows that with the new protocol's equivalent of a
3235   response to a GET on the target resource.  This allows a connection to be
3236   upgraded to protocols with the same semantics as HTTP without the
3237   latency cost of an additional round-trip.  A server MUST NOT switch
3238   protocols unless the received message semantics can be honored by the new
3239   protocol; an OPTIONS request can be honored by any protocol.
3242   The following is an example response to the above hypothetical request:
3243</preamble><artwork type="message/http; msgtype=&#34;response&#34;"><![CDATA[
3244  HTTP/1.1 101 Switching Protocols
3245  Connection: upgrade
3246  Upgrade: HTTP/2.0
3248  [... data stream switches to HTTP/2.0 with an appropriate response
3249  (as defined by new protocol) to the "GET /hello.txt" request ...]
3250  ]]></artwork></figure>
3252   When Upgrade is sent, the sender MUST also send a
3253   <xref target="header.connection" format="none">Connection</xref> header field (<xref target="header.connection"/>)
3254   that contains an "upgrade" connection option, in order to prevent Upgrade
3255   from being accidentally forwarded by intermediaries that might not implement
3256   the listed protocols.  A server MUST ignore an Upgrade header field that
3257   is received in an HTTP/1.0 request.
3260   A client cannot begin using an upgraded protocol on the connection until
3261   it has completely sent the request message (i.e., the client can't change
3262   the protocol it is sending in the middle of a message).
3263   If a server receives both Upgrade and an Expect header field
3264   with the "100-continue" expectation (Section 5.1.1 of <xref target="Part2"/>), the
3265   server MUST send a 100 (Continue) response before sending
3266   a 101 (Switching Protocols) response.
3269   The Upgrade header field only applies to switching protocols on top of the
3270   existing connection; it cannot be used to switch the underlying connection
3271   (transport) protocol, nor to switch the existing communication to a
3272   different connection. For those purposes, it is more appropriate to use a
3273   3xx (Redirection) response (Section 6.4 of <xref target="Part2"/>).
3276   This specification only defines the protocol name "HTTP" for use by
3277   the family of Hypertext Transfer Protocols, as defined by the HTTP
3278   version rules of <xref target="http.version"/> and future updates to this
3279   specification. Additional tokens ought to be registered with IANA using the
3280   registration procedure defined in <xref target="upgrade.token.registry"/>.
3285<section title="ABNF list extension: #rule" anchor="abnf.extension">
3287   A #rule extension to the ABNF rules of <xref target="RFC5234"/> is used to
3288   improve readability in the definitions of some header field values.
3291   A construct "#" is defined, similar to "*", for defining comma-delimited
3292   lists of elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating
3293   at least &lt;n&gt; and at most &lt;m&gt; elements, each separated by a single
3294   comma (",") and optional whitespace (OWS).   
3297   In any production that uses the list construct, a sender MUST NOT
3298   generate empty list elements. In other words, a sender MUST generate
3299   lists that satisfy the following syntax:
3300</preamble><artwork type="example"><![CDATA[
3301  1#element => element *( OWS "," OWS element )
3304   and:
3305</preamble><artwork type="example"><![CDATA[
3306  #element => [ 1#element ]
3309   and for n &gt;= 1 and m &gt; 1:
3310</preamble><artwork type="example"><![CDATA[
3311  <n>#<m>element => element <n-1>*<m-1>( OWS "," OWS element )
3314   For compatibility with legacy list rules, a recipient MUST parse and ignore
3315   a reasonable number of empty list elements: enough to handle common mistakes
3316   by senders that merge values, but not so much that they could be used as a
3317   denial of service mechanism. In other words, a recipient MUST accept lists
3318   that satisfy the following syntax:
3320<figure><artwork type="example"><![CDATA[
3321  #element => [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
3323  1#element => *( "," OWS ) element *( OWS "," [ OWS element ] )
3326   Empty elements do not contribute to the count of elements present.
3327   For example, given these ABNF productions:
3329<figure><artwork type="example"><![CDATA[
3330  example-list      = 1#example-list-elmt
3331  example-list-elmt = token ; see Section 3.2.6
3334   Then the following are valid values for example-list (not including the
3335   double quotes, which are present for delimitation only):
3337<figure><artwork type="example"><![CDATA[
3338  "foo,bar"
3339  "foo ,bar,"
3340  "foo , ,bar,charlie   "
3343   In contrast, the following values would be invalid, since at least one
3344   non-empty element is required by the example-list production:
3346<figure><artwork type="example"><![CDATA[
3347  ""
3348  ","
3349  ",   ,"
3352   <xref target="collected.abnf"/> shows the collected ABNF for recipients
3353   after the list constructs have been expanded.
3357<section title="IANA Considerations" anchor="IANA.considerations">
3359<section title="Header Field Registration" anchor="header.field.registration">
3361   HTTP header fields are registered within the Message Header Field Registry
3362   maintained at
3363   <eref target=""/>.
3366   This document defines the following HTTP header fields, so their
3367   associated registry entries shall be updated according to the permanent
3368   registrations below (see <xref target="BCP90"/>):
3371<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
3372<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
3373   <ttcol>Header Field Name</ttcol>
3374   <ttcol>Protocol</ttcol>
3375   <ttcol>Status</ttcol>
3376   <ttcol>Reference</ttcol>
3378   <c>Connection</c>
3379   <c>http</c>
3380   <c>standard</c>
3381   <c>
3382      <xref target="header.connection"/>
3383   </c>
3384   <c>Content-Length</c>
3385   <c>http</c>
3386   <c>standard</c>
3387   <c>
3388      <xref target="header.content-length"/>
3389   </c>
3390   <c>Host</c>
3391   <c>http</c>
3392   <c>standard</c>
3393   <c>
3394      <xref target=""/>
3395   </c>
3396   <c>TE</c>
3397   <c>http</c>
3398   <c>standard</c>
3399   <c>
3400      <xref target="header.te"/>
3401   </c>
3402   <c>Trailer</c>
3403   <c>http</c>
3404   <c>standard</c>
3405   <c>
3406      <xref target="header.trailer"/>
3407   </c>
3408   <c>Transfer-Encoding</c>
3409   <c>http</c>
3410   <c>standard</c>
3411   <c>
3412      <xref target="header.transfer-encoding"/>
3413   </c>
3414   <c>Upgrade</c>
3415   <c>http</c>
3416   <c>standard</c>
3417   <c>
3418      <xref target="header.upgrade"/>
3419   </c>
3420   <c>Via</c>
3421   <c>http</c>
3422   <c>standard</c>
3423   <c>
3424      <xref target="header.via"/>
3425   </c>
3430   Furthermore, the header field-name "Close" shall be registered as
3431   "reserved", since using that name as an HTTP header field might
3432   conflict with the "close" connection option of the "<xref target="header.connection" format="none">Connection</xref>"
3433   header field (<xref target="header.connection"/>).
3435<texttable align="left" suppress-title="true">
3436   <ttcol>Header Field Name</ttcol>
3437   <ttcol>Protocol</ttcol>
3438   <ttcol>Status</ttcol>
3439   <ttcol>Reference</ttcol>
3441   <c>Close</c>
3442   <c>http</c>
3443   <c>reserved</c>
3444   <c>
3445      <xref target="header.field.registration"/>
3446   </c>
3449   The change controller is: "IETF ( - Internet Engineering Task Force".
3453<section title="URI Scheme Registration" anchor="uri.scheme.registration">
3455   IANA maintains the registry of URI Schemes <xref target="BCP115"/> at
3456   <eref target=""/>.
3459   This document defines the following URI schemes, so their
3460   associated registry entries shall be updated according to the permanent
3461   registrations below:
3463<texttable align="left" suppress-title="true">
3464   <ttcol>URI Scheme</ttcol>
3465   <ttcol>Description</ttcol>
3466   <ttcol>Reference</ttcol>
3468   <c>http</c>
3469   <c>Hypertext Transfer Protocol</c>
3470   <c><xref target="http.uri"/></c>
3472   <c>https</c>
3473   <c>Hypertext Transfer Protocol Secure</c>
3474   <c><xref target="https.uri"/></c>
3478<section title="Internet Media Type Registration" anchor="">
3480   IANA maintains the registry of Internet media types <xref target="BCP13"/> at
3481   <eref target=""/>.
3484   This document serves as the specification for the Internet media types
3485   "message/http" and "application/http". The following is to be registered with
3486   IANA.
3488<section title="Internet Media Type message/http" anchor="">
3489<iref item="Media Type" subitem="message/http" primary="true"/>
3490<iref item="message/http Media Type" primary="true"/>
3492   The message/http type can be used to enclose a single HTTP request or
3493   response message, provided that it obeys the MIME restrictions for all
3494   "message" types regarding line length and encodings.
3497  <list style="hanging">
3498    <t hangText="Type name:">
3499      message
3500    </t>
3501    <t hangText="Subtype name:">
3502      http
3503    </t>
3504    <t hangText="Required parameters:">
3505      N/A
3506    </t>
3507    <t hangText="Optional parameters:">
3508      version, msgtype
3509      <list style="hanging">
3510        <t hangText="version:">
3511          The HTTP-version number of the enclosed message
3512          (e.g., "1.1"). If not present, the version can be
3513          determined from the first line of the body.
3514        </t>
3515        <t hangText="msgtype:">
3516          The message type — "request" or "response". If not
3517          present, the type can be determined from the first
3518          line of the body.
3519        </t>
3520      </list>
3521    </t>
3522    <t hangText="Encoding considerations:">
3523      only "7bit", "8bit", or "binary" are permitted
3524    </t>
3525    <t hangText="Security considerations:">
3526      see <xref target="security.considerations"/>
3527    </t>
3528    <t hangText="Interoperability considerations:">
3529      N/A
3530    </t>
3531    <t hangText="Published specification:">
3532      This specification (see <xref target=""/>).
3533    </t>
3534    <t hangText="Applications that use this media type:">
3535      N/A
3536    </t>
3537    <t hangText="Fragment identifier considerations:">
3538      N/A
3539    </t>
3540    <t hangText="Additional information:">
3541      <list style="hanging">
3542        <t hangText="Magic number(s):">N/A</t>
3543        <t hangText="Deprecated alias names for this type:">N/A</t>
3544        <t hangText="File extension(s):">N/A</t>
3545        <t hangText="Macintosh file type code(s):">N/A</t>
3546      </list>
3547    </t>
3548    <t hangText="Person and email address to contact for further information:">
3549      See Authors Section.
3550    </t>
3551    <t hangText="Intended usage:">
3552      COMMON
3553    </t>
3554    <t hangText="Restrictions on usage:">
3555      N/A
3556    </t>
3557    <t hangText="Author:">
3558      See Authors Section.
3559    </t>
3560    <t hangText="Change controller:">
3561      IESG
3562    </t>
3563  </list>
3566<section title="Internet Media Type application/http" anchor="">
3567<iref item="Media Type" subitem="application/http" primary="true"/>
3568<iref item="application/http Media Type" primary="true"/>
3570   The application/http type can be used to enclose a pipeline of one or more
3571   HTTP request or response messages (not intermixed).
3574  <list style="hanging">
3575    <t hangText="Type name:">
3576      application
3577    </t>
3578    <t hangText="Subtype name:">
3579      http
3580    </t>
3581    <t hangText="Required parameters:">
3582      N/A
3583    </t>
3584    <t hangText="Optional parameters:">
3585      version, msgtype
3586      <list style="hanging">
3587        <t hangText="version:">
3588          The HTTP-version number of the enclosed messages
3589          (e.g., "1.1"). If not present, the version can be
3590          determined from the first line of the body.
3591        </t>
3592        <t hangText="msgtype:">
3593          The message type — "request" or "response". If not
3594          present, the type can be determined from the first
3595          line of the body.
3596        </t>
3597      </list>
3598    </t>
3599    <t hangText="Encoding considerations:">
3600      HTTP messages enclosed by this type
3601      are in "binary" format; use of an appropriate
3602      Content-Transfer-Encoding is required when
3603      transmitted via E-mail.
3604    </t>
3605    <t hangText="Security considerations:">
3606      see <xref target="security.considerations"/>
3607    </t>
3608    <t hangText="Interoperability considerations:">
3609      N/A
3610    </t>
3611    <t hangText="Published specification:">
3612      This specification (see <xref target=""/>).
3613    </t>
3614    <t hangText="Applications that use this media type:">
3615      N/A
3616    </t>
3617    <t hangText="Fragment identifier considerations:">
3618      N/A
3619    </t>
3620    <t hangText="Additional information:">
3621      <list style="hanging">
3622        <t hangText="Deprecated alias names for this type:">N/A</t>
3623        <t hangText="Magic number(s):">N/A</t>
3624        <t hangText="File extension(s):">N/A</t>
3625        <t hangText="Macintosh file type code(s):">N/A</t>
3626      </list>
3627    </t>
3628    <t hangText="Person and email address to contact for further information:">
3629      See Authors Section.
3630    </t>
3631    <t hangText="Intended usage:">
3632      COMMON
3633    </t>
3634    <t hangText="Restrictions on usage:">
3635      N/A
3636    </t>
3637    <t hangText="Author:">
3638      See Authors Section.
3639    </t>
3640    <t hangText="Change controller:">
3641      IESG
3642    </t>
3643  </list>
3648<section title="Transfer Coding Registry" anchor="transfer.coding.registry">
3650   The HTTP Transfer Coding Registry defines the name space for transfer
3651   coding names. It is maintained at <eref target=""/>.
3654<section title="Procedure" anchor="transfer.coding.registry.procedure">
3656   Registrations MUST include the following fields:
3657   <list style="symbols">
3658     <t>Name</t>
3659     <t>Description</t>
3660     <t>Pointer to specification text</t>
3661   </list>
3664   Names of transfer codings MUST NOT overlap with names of content codings
3665   (Section of <xref target="Part2"/>) unless the encoding transformation is identical, as
3666   is the case for the compression codings defined in
3667   <xref target="compression.codings"/>.
3670   Values to be added to this name space require IETF Review (see
3671   Section 4.1 of <xref target="RFC5226"/>), and MUST
3672   conform to the purpose of transfer coding defined in this specification.
3675   Use of program names for the identification of encoding formats
3676   is not desirable and is discouraged for future encodings.
3680<section title="Registration" anchor="transfer.coding.registration">
3682   The HTTP Transfer Coding Registry shall be updated with the registrations
3683   below:
3685<texttable align="left" suppress-title="true" anchor="iana.transfer.coding.registration.table">
3686   <ttcol>Name</ttcol>
3687   <ttcol>Description</ttcol>
3688   <ttcol>Reference</ttcol>
3689   <c>chunked</c>
3690   <c>Transfer in a series of chunks</c>
3691   <c>
3692      <xref target="chunked.encoding"/>
3693   </c>
3694   <c>compress</c>
3695   <c>UNIX "compress" data format <xref target="Welch"/></c>
3696   <c>
3697      <xref target="compress.coding"/>
3698   </c>
3699   <c>deflate</c>
3700   <c>"deflate" compressed data (<xref target="RFC1951"/>) inside
3701   the "zlib" data format (<xref target="RFC1950"/>)
3702   </c>
3703   <c>
3704      <xref target="deflate.coding"/>
3705   </c>
3706   <c>gzip</c>
3707   <c>GZIP file format <xref target="RFC1952"/></c>
3708   <c>
3709      <xref target="gzip.coding"/>
3710   </c>
3711   <c>x-compress</c>
3712   <c>Deprecated (alias for compress)</c>
3713   <c>
3714      <xref target="compress.coding"/>
3715   </c>
3716   <c>x-gzip</c>
3717   <c>Deprecated (alias for gzip)</c>
3718   <c>
3719      <xref target="gzip.coding"/>
3720   </c>
3725<section title="Content Coding Registration" anchor="content.coding.registration">
3727   IANA maintains the registry of HTTP Content Codings at
3728   <eref target=""/>.
3731   The HTTP Content Codings Registry shall be updated with the registrations
3732   below:
3734<texttable align="left" suppress-title="true" anchor="iana.content.coding.registration.table">
3735   <ttcol>Name</ttcol>
3736   <ttcol>Description</ttcol>
3737   <ttcol>Reference</ttcol>
3738   <c>compress</c>
3739   <c>UNIX "compress" data format <xref target="Welch"/></c>
3740   <c>
3741      <xref target="compress.coding"/>
3742   </c>
3743   <c>deflate</c>
3744   <c>"deflate" compressed data (<xref target="RFC1951"/>) inside
3745   the "zlib" data format (<xref target="RFC1950"/>)</c>
3746   <c>
3747      <xref target="deflate.coding"/>
3748   </c>
3749   <c>gzip</c>
3750   <c>GZIP file format <xref target="RFC1952"/></c>
3751   <c>
3752      <xref target="gzip.coding"/>
3753   </c>
3754   <c>x-compress</c>
3755   <c>Deprecated (alias for compress)</c>
3756   <c>
3757      <xref target="compress.coding"/>
3758   </c>
3759   <c>x-gzip</c>
3760   <c>Deprecated (alias for gzip)</c>
3761   <c>
3762      <xref target="gzip.coding"/>
3763   </c>
3767<section title="Upgrade Token Registry" anchor="upgrade.token.registry">
3769   The HTTP Upgrade Token Registry defines the name space for protocol-name
3770   tokens used to identify protocols in the <xref target="header.upgrade" format="none">Upgrade</xref> header
3771   field. The registry is maintained at <eref target=""/>.
3774<section title="Procedure" anchor="upgrade.token.registry.procedure">  
3776   Each registered protocol name is associated with contact information
3777   and an optional set of specifications that details how the connection
3778   will be processed after it has been upgraded.
3781   Registrations happen on a "First Come First Served" basis (see
3782   Section 4.1 of <xref target="RFC5226"/>) and are subject to the
3783   following rules:
3784  <list style="numbers">
3785    <t>A protocol-name token, once registered, stays registered forever.</t>
3786    <t>The registration MUST name a responsible party for the
3787       registration.</t>
3788    <t>The registration MUST name a point of contact.</t>
3789    <t>The registration MAY name a set of specifications associated with
3790       that token. Such specifications need not be publicly available.</t>
3791    <t>The registration SHOULD name a set of expected "protocol-version"
3792       tokens associated with that token at the time of registration.</t>
3793    <t>The responsible party MAY change the registration at any time.
3794       The IANA will keep a record of all such changes, and make them
3795       available upon request.</t>
3796    <t>The IESG MAY reassign responsibility for a protocol token.
3797       This will normally only be used in the case when a
3798       responsible party cannot be contacted.</t>
3799  </list>
3802   This registration procedure for HTTP Upgrade Tokens replaces that
3803   previously defined in Section 7.2 of <xref target="RFC2817"/>.
3807<section title="Upgrade Token Registration" anchor="upgrade.token.registration">
3809   The "HTTP" entry in the HTTP Upgrade Token Registry shall be updated with
3810   the registration below:
3812<texttable align="left" suppress-title="true">
3813   <ttcol>Value</ttcol>
3814   <ttcol>Description</ttcol>
3815   <ttcol>Expected Version Tokens</ttcol>
3816   <ttcol>Reference</ttcol>
3818   <c>HTTP</c>
3819   <c>Hypertext Transfer Protocol</c>
3820   <c>any DIGIT.DIGIT (e.g, "2.0")</c>
3821   <c><xref target="http.version"/></c>
3824   The responsible party is: "IETF ( - Internet Engineering Task Force".
3831<section title="Security Considerations" anchor="security.considerations">
3833   This section is meant to inform developers, information providers, and
3834   users of known security considerations relevant to HTTP message syntax,
3835   parsing, and routing. Security considerations about HTTP semantics and
3836   payloads are addressed in <xref target="Part2"/>.
3839<section title="Establishing Authority" anchor="establishing.authority">
3840  <iref item="authoritative response" primary="true"/>
3841  <iref item="phishing" primary="true"/>
3843   HTTP relies on the notion of an authoritative response: a
3844   response that has been determined by (or at the direction of) the authority
3845   identified within the target URI to be the most appropriate response for
3846   that request given the state of the target resource at the time of
3847   response message origination. Providing a response from a non-authoritative
3848   source, such as a shared cache, is often useful to improve performance and
3849   availability, but only to the extent that the source can be trusted or
3850   the distrusted response can be safely used.
3853   Unfortunately, establishing authority can be difficult.
3854   For example, phishing is an attack on the user's perception
3855   of authority, where that perception can be misled by presenting similar
3856   branding in hypertext, possibly aided by userinfo obfuscating the authority
3857   component (see <xref target="http.uri"/>).
3858   User agents can reduce the impact of phishing attacks by enabling users to
3859   easily inspect a target URI prior to making an action, by prominently
3860   distinguishing (or rejecting) userinfo when present, and by not sending
3861   stored credentials and cookies when the referring document is from an
3862   unknown or untrusted source.
3865   When a registered name is used in the authority component, the "http" URI
3866   scheme (<xref target="http.uri"/>) relies on the user's local name
3867   resolution service to determine where it can find authoritative responses.
3868   This means that any attack on a user's network host table, cached names, or
3869   name resolution libraries becomes an avenue for attack on establishing
3870   authority. Likewise, the user's choice of server for Domain Name Service
3871   (DNS), and the hierarchy of servers from which it obtains resolution
3872   results, could impact the authenticity of address mappings;
3873   DNSSEC (<xref target="RFC4033"/>) is one way to improve authenticity.
3876   Furthermore, after an IP address is obtained, establishing authority for
3877   an "http" URI is vulnerable to attacks on Internet Protocol routing.
3880   The "https" scheme (<xref target="https.uri"/>) is intended to prevent
3881   (or at least reveal) many of these potential attacks on establishing
3882   authority, provided that the negotiated TLS connection is secured and
3883   the client properly verifies that the communicating server's identity
3884   matches the target URI's authority component
3885   (see <xref target="RFC2818"/>). Correctly implementing such verification
3886   can be difficult (see <xref target="Georgiev"/>).
3890<section title="Risks of Intermediaries" anchor="risks.intermediaries">
3892   By their very nature, HTTP intermediaries are men-in-the-middle, and thus
3893   represent an opportunity for man-in-the-middle attacks. Compromise of
3894   the systems on which the intermediaries run can result in serious security
3895   and privacy problems. Intermediaries might have access to security-related
3896   information, personal information about individual users and
3897   organizations, and proprietary information belonging to users and
3898   content providers. A compromised intermediary, or an intermediary
3899   implemented or configured without regard to security and privacy
3900   considerations, might be used in the commission of a wide range of
3901   potential attacks.
3904   Intermediaries that contain a shared cache are especially vulnerable
3905   to cache poisoning attacks, as described in Section 8 of <xref target="Part6"/>.
3908   Implementers need to consider the privacy and security
3909   implications of their design and coding decisions, and of the
3910   configuration options they provide to operators (especially the
3911   default configuration).
3914   Users need to be aware that intermediaries are no more trustworthy than
3915   the people who run them; HTTP itself cannot solve this problem.
3919<section title="Attacks via Protocol Element Length" anchor="attack.protocol.element.length">
3921   Because HTTP uses mostly textual, character-delimited fields, parsers are
3922   often vulnerable to attacks based on sending very long (or very slow)
3923   streams of data, particularly where an implementation is expecting a
3924   protocol element with no predefined length.
3927   To promote interoperability, specific recommendations are made for minimum
3928   size limits on request-line (<xref target="request.line"/>)
3929   and header fields (<xref target="header.fields"/>). These are
3930   minimum recommendations, chosen to be supportable even by implementations
3931   with limited resources; it is expected that most implementations will
3932   choose substantially higher limits.
3935   A server can reject a message that
3936   has a request-target that is too long (Section 6.5.12 of <xref target="Part2"/>) or a request payload
3937   that is too large (Section 6.5.11 of <xref target="Part2"/>). Additional status codes related to
3938   capacity limits have been defined by extensions to HTTP
3939   <xref target="RFC6585"/>.
3942   Recipients ought to carefully limit the extent to which they process other
3943   protocol elements, including (but not limited to) request methods, response
3944   status phrases, header field-names, numeric values, and body chunks.
3945   Failure to limit such processing can result in buffer overflows, arithmetic
3946   overflows, or increased vulnerability to denial of service attacks.
3950<section title="Response Splitting" anchor="response.splitting">
3952   Response splitting (a.k.a, CRLF injection) is a common technique, used in
3953   various attacks on Web usage, that exploits the line-based nature of HTTP
3954   message framing and the ordered association of requests to responses on
3955   persistent connections <xref target="Klein"/>. This technique can be
3956   particularly damaging when the requests pass through a shared cache.
3959   Response splitting exploits a vulnerability in servers (usually within an
3960   application server) where an attacker can send encoded data within some
3961   parameter of the request that is later decoded and echoed within any of the
3962   response header fields of the response. If the decoded data is crafted to
3963   look like the response has ended and a subsequent response has begun, the
3964   response has been split and the content within the apparent second response
3965   is controlled by the attacker. The attacker can then make any other request
3966   on the same persistent connection and trick the recipients (including
3967   intermediaries) into believing that the second half of the split is an
3968   authoritative answer to the second request.
3971   For example, a parameter within the request-target might be read by an
3972   application server and reused within a redirect, resulting in the same
3973   parameter being echoed in the Location header field of the
3974   response. If the parameter is decoded by the application and not properly
3975   encoded when placed in the response field, the attacker can send encoded
3976   CRLF octets and other content that will make the application's single
3977   response look like two or more responses.
3980   A common defense against response splitting is to filter requests for data
3981   that looks like encoded CR and LF (e.g., "%0D" and "%0A"). However, that
3982   assumes the application server is only performing URI decoding, rather
3983   than more obscure data transformations like charset transcoding, XML entity
3984   translation, base64 decoding, sprintf reformatting, etc.  A more effective
3985   mitigation is to prevent anything other than the server's core protocol
3986   libraries from sending a CR or LF within the header section, which means
3987   restricting the output of header fields to APIs that filter for bad octets
3988   and not allowing application servers to write directly to the protocol
3989   stream.
3993<section title="Request Smuggling" anchor="request.smuggling">
3995   Request smuggling (<xref target="Linhart"/>) is a technique that exploits
3996   differences in protocol parsing among various recipients to hide additional
3997   requests (which might otherwise be blocked or disabled by policy) within an
3998   apparently harmless request.  Like response splitting, request smuggling
3999   can lead to a variety of attacks on HTTP usage.
4002   This specification has introduced new requirements on request parsing,
4003   particularly with regard to message framing in
4004   <xref target="message.body.length"/>, to reduce the effectiveness of
4005   request smuggling.
4009<section title="Message Integrity" anchor="message.integrity">
4011   HTTP does not define a specific mechanism for ensuring message integrity,
4012   instead relying on the error-detection ability of underlying transport
4013   protocols and the use of length or chunk-delimited framing to detect
4014   completeness. Additional integrity mechanisms, such as hash functions or
4015   digital signatures applied to the content, can be selectively added to
4016   messages via extensible metadata header fields. Historically, the lack of
4017   a single integrity mechanism has been justified by the informal nature of
4018   most HTTP communication.  However, the prevalence of HTTP as an information
4019   access mechanism has resulted in its increasing use within environments
4020   where verification of message integrity is crucial.
4023   User agents are encouraged to implement configurable means for detecting
4024   and reporting failures of message integrity such that those means can be
4025   enabled within environments for which integrity is necessary. For example,
4026   a browser being used to view medical history or drug interaction
4027   information needs to indicate to the user when such information is detected
4028   by the protocol to be incomplete, expired, or corrupted during transfer.
4029   Such mechanisms might be selectively enabled via user agent extensions or
4030   the presence of message integrity metadata in a response.
4031   At a minimum, user agents ought to provide some indication that allows a
4032   user to distinguish between a complete and incomplete response message
4033   (<xref target="incomplete.messages"/>) when such verification is desired.
4037<section title="Message Confidentiality" anchor="message.confidentiality">
4039   HTTP relies on underlying transport protocols to provide message
4040   confidentiality when that is desired. HTTP has been specifically designed
4041   to be independent of the transport protocol, such that it can be used
4042   over many different forms of encrypted connection, with the selection of
4043   such transports being identified by the choice of URI scheme or within
4044   user agent configuration.
4047   The "https" scheme can be used to identify resources that require a
4048   confidential connection, as described in <xref target="https.uri"/>.
4052<section title="Privacy of Server Log Information" anchor="privacy.of.server.log.information">
4054   A server is in the position to save personal data about a user's requests
4055   over time, which might identify their reading patterns or subjects of
4056   interest.  In particular, log information gathered at an intermediary
4057   often contains a history of user agent interaction, across a multitude
4058   of sites, that can be traced to individual users.
4061   HTTP log information is confidential in nature; its handling is often
4062   constrained by laws and regulations.  Log information needs to be securely
4063   stored and appropriate guidelines followed for its analysis.
4064   Anonymization of personal information within individual entries helps,
4065   but is generally not sufficient to prevent real log traces from being
4066   re-identified based on correlation with other access characteristics.
4067   As such, access traces that are keyed to a specific client are unsafe to
4068   publish even if the key is pseudonymous.
4071   To minimize the risk of theft or accidental publication, log information
4072   ought to be purged of personally identifiable information, including
4073   user identifiers, IP addresses, and user-provided query parameters,
4074   as soon as that information is no longer necessary to support operational
4075   needs for security, auditing, or fraud control.
4080<section title="Acknowledgments" anchor="acks">
4082   This edition of HTTP/1.1 builds on the many contributions that went into
4083   <xref target="RFC1945" format="none">RFC 1945</xref>,
4084   <xref target="RFC2068" format="none">RFC 2068</xref>,
4085   <xref target="RFC2145" format="none">RFC 2145</xref>, and
4086   <xref target="RFC2616" format="none">RFC 2616</xref>, including
4087   substantial contributions made by the previous authors, editors, and
4088   working group chairs: Tim Berners-Lee, Ari Luotonen, Roy T. Fielding,
4089   Henrik Frystyk Nielsen, Jim Gettys, Jeffrey C. Mogul, Larry Masinter,
4090   and Paul J. Leach. Mark Nottingham oversaw this effort as working group chair.
4093   Since 1999, the following contributors have helped improve the HTTP
4094   specification by reporting bugs, asking smart questions, drafting or
4095   reviewing text, and evaluating open issues:
4098<t>Adam Barth,
4099Adam Roach,
4100Addison Phillips,
4101Adrian Chadd,
4102Adrian Cole,
4103Adrien W. de Croy,
4104Alan Ford,
4105Alan Ruttenberg,
4106Albert Lunde,
4107Alek Storm,
4108Alex Rousskov,
4109Alexandre Morgaut,
4110Alexey Melnikov,
4111Alisha Smith,
4112Amichai Rothman,
4113Amit Klein,
4114Amos Jeffries,
4115Andreas Maier,
4116Andreas Petersson,
4117Andrei Popov,
4118Anil Sharma,
4119Anne van Kesteren,
4120Anthony Bryan,
4121Asbjorn Ulsberg,
4122Ashok Kumar,
4123Balachander Krishnamurthy,
4124Barry Leiba,
4125Ben Laurie,
4126Benjamin Carlyle,
4127Benjamin Niven-Jenkins,
4128Benoit Claise,
4129Bil Corry,
4130Bill Burke,
4131Bjoern Hoehrmann,
4132Bob Scheifler,
4133Boris Zbarsky,
4134Brett Slatkin,
4135Brian Kell,
4136Brian McBarron,
4137Brian Pane,
4138Brian Raymor,
4139Brian Smith,
4140Bruce Perens,
4141Bryce Nesbitt,
4142Cameron Heavon-Jones,
4143Carl Kugler,
4144Carsten Bormann,
4145Charles Fry,
4146Chris Burdess,
4147Chris Newman,
4148Christian Huitema,
4149Cyrus Daboo,
4150Dale Robert Anderson,
4151Dan Wing,
4152Dan Winship,
4153Daniel Stenberg,
4154Darrel Miller,
4155Dave Cridland,
4156Dave Crocker,
4157Dave Kristol,
4158Dave Thaler,
4159David Booth,
4160David Singer,
4161David W. Morris,
4162Diwakar Shetty,
4163Dmitry Kurochkin,
4164Drummond Reed,
4165Duane Wessels,
4166Edward Lee,
4167Eitan Adler,
4168Eliot Lear,
4169Emile Stephan,
4170Eran Hammer-Lahav,
4171Eric D. Williams,
4172Eric J. Bowman,
4173Eric Lawrence,
4174Eric Rescorla,
4175Erik Aronesty,
4176EungJun Yi,
4177Evan Prodromou,
4178Felix Geisendoerfer,
4179Florian Weimer,
4180Frank Ellermann,
4181Fred Akalin,
4182Fred Bohle,
4183Frederic Kayser,
4184Gabor Molnar,
4185Gabriel Montenegro,
4186Geoffrey Sneddon,
4187Gervase Markham,
4188Gili Tzabari,
4189Grahame Grieve,
4190Greg Slepak,
4191Greg Wilkins,
4192Grzegorz Calkowski,
4193Harald Tveit Alvestrand,
4194Harry Halpin,
4195Helge Hess,
4196Henrik Nordstrom,
4197Henry S. Thompson,
4198Henry Story,
4199Herbert van de Sompel,
4200Herve Ruellan,
4201Howard Melman,
4202Hugo Haas,
4203Ian Fette,
4204Ian Hickson,
4205Ido Safruti,
4206Ilari Liusvaara,
4207Ilya Grigorik,
4208Ingo Struck,
4209J. Ross Nicoll,
4210James Cloos,
4211James H. Manger,
4212James Lacey,
4213James M. Snell,
4214Jamie Lokier,
4215Jan Algermissen,
4216Jari Arkko,
4217Jeff Hodges (who came up with the term 'effective Request-URI'),
4218Jeff Pinner,
4219Jeff Walden,
4220Jim Luther,
4221Jitu Padhye,
4222Joe D. Williams,
4223Joe Gregorio,
4224Joe Orton,
4225Joel Jaeggli,
4226John C. Klensin,
4227John C. Mallery,
4228John Cowan,
4229John Kemp,
4230John Panzer,
4231John Schneider,
4232John Stracke,
4233John Sullivan,
4234Jonas Sicking,
4235Jonathan A. Rees,
4236Jonathan Billington,
4237Jonathan Moore,
4238Jonathan Silvera,
4239Jordi Ros,
4240Joris Dobbelsteen,
4241Josh Cohen,
4242Julien Pierre,
4243Jungshik Shin,
4244Justin Chapweske,
4245Justin Erenkrantz,
4246Justin James,
4247Kalvinder Singh,
4248Karl Dubost,
4249Kathleen Moriarty,
4250Keith Hoffman,
4251Keith Moore,
4252Ken Murchison,
4253Koen Holtman,
4254Konstantin Voronkov,
4255Kris Zyp,
4256Leif Hedstrom,
4257Lionel Morand,
4258Lisa Dusseault,
4259Maciej Stachowiak,
4260Manu Sporny,
4261Marc Schneider,
4262Marc Slemko,
4263Mark Baker,
4264Mark Pauley,
4265Mark Watson,
4266Markus Isomaki,
4267Markus Lanthaler,
4268Martin J. Duerst,
4269Martin Musatov,
4270Martin Nilsson,
4271Martin Thomson,
4272Matt Lynch,
4273Matthew Cox,
4274Matthew Kerwin,
4275Max Clark,
4276Menachem Dodge,
4277Meral Shirazipour,
4278Michael Burrows,
4279Michael Hausenblas,
4280Michael Scharf,
4281Michael Sweet,
4282Michael Tuexen,
4283Michael Welzl,
4284Mike Amundsen,
4285Mike Belshe,
4286Mike Bishop,
4287Mike Kelly,
4288Mike Schinkel,
4289Miles Sabin,
4290Murray S. Kucherawy,
4291Mykyta Yevstifeyev,
4292Nathan Rixham,
4293Nicholas Shanks,
4294Nico Williams,
4295Nicolas Alvarez,
4296Nicolas Mailhot,
4297Noah Slater,
4298Osama Mazahir,
4299Pablo Castro,
4300Pat Hayes,
4301Patrick R. McManus,
4302Paul E. Jones,
4303Paul Hoffman,
4304Paul Marquess,
4305Pete Resnick,
4306Peter Lepeska,
4307Peter Occil,
4308Peter Saint-Andre,
4309Peter Watkins,
4310Phil Archer,
4311Phil Hunt,
4312Philippe Mougin,
4313Phillip Hallam-Baker,
4314Piotr Dobrogost,
4315Poul-Henning Kamp,
4316Preethi Natarajan,
4317Rajeev Bector,
4318Ray Polk,
4319Reto Bachmann-Gmuer,
4320Richard Barnes,
4321Richard Cyganiak,
4322Rob Trace,
4323Robby Simpson,
4324Robert Brewer,
4325Robert Collins,
4326Robert Mattson,
4327Robert O'Callahan,
4328Robert Olofsson,
4329Robert Sayre,
4330Robert Siemer,
4331Robert de Wilde,
4332Roberto Javier Godoy,
4333Roberto Peon,
4334Roland Zink,
4335Ronny Widjaja,
4336Ryan Hamilton,
4337S. Mike Dierken,
4338Salvatore Loreto,
4339Sam Johnston,
4340Sam Pullara,
4341Sam Ruby,
4342Saurabh Kulkarni,
4343Scott Lawrence (who maintained the original issues list),
4344Sean B. Palmer,
4345Sean Turner,
4346Sebastien Barnoud,
4347Shane McCarron,
4348Shigeki Ohtsu,
4349Simon Yarde,
4350Stefan Eissing,
4351Stefan Tilkov,
4352Stefanos Harhalakis,
4353Stephane Bortzmeyer,
4354Stephen Farrell,
4355Stephen Kent,
4356Stephen Ludin,
4357Stuart Williams,
4358Subbu Allamaraju,
4359Subramanian Moonesamy,
4360Susan Hares,
4361Sylvain Hellegouarch,
4362Tapan Divekar,
4363Tatsuhiro Tsujikawa,
4364Tatsuya Hayashi,
4365Ted Hardie,
4366Ted Lemon,
4367Thomas Broyer,
4368Thomas Fossati,
4369Thomas Maslen,
4370Thomas Nadeau,
4371Thomas Nordin,
4372Thomas Roessler,
4373Tim Bray,
4374Tim Morgan,
4375Tim Olsen,
4376Tom Zhou,
4377Travis Snoozy,
4378Tyler Close,
4379Vincent Murphy,
4380Wenbo Zhu,
4381Werner Baumann,
4382Wilbur Streett,
4383Wilfredo Sanchez Vega,
4384William A. Rowe Jr.,
4385William Chan,
4386Willy Tarreau,
4387Xiaoshu Wang,
4388Yaron Goland,
4389Yngve Nysaeter Pettersen,
4390Yoav Nir,
4391Yogesh Bang,
4392Yuchung Cheng,
4393Yutaka Oiwa,
4394Yves Lafon (long-time member of the editor team),
4395Zed A. Shaw, and
4396Zhong Yu.
4400   See Section 16 of <xref target="RFC2616"/> for additional
4401   acknowledgements from prior revisions.
4408<references title="Normative References">
4410<reference anchor="Part2">
4411  <front>
4412    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
4413    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4414      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4415      <address><email></email></address>
4416    </author>
4417    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4418      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4419      <address><email></email></address>
4420    </author>
4421    <date month="February" year="2014"/>
4422  </front>
4423  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-26"/>
4427<reference anchor="Part4">
4428  <front>
4429    <title>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>
4430    <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
4431      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4432      <address><email></email></address>
4433    </author>
4434    <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
4435      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4436      <address><email></email></address>
4437    </author>
4438    <date month="February" year="2014"/>
4439  </front>
4440  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-26"/>
4444<reference anchor="Part5">
4445  <front>
4446    <title>Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>
4447    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4448      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4449      <address><email></email></address>
4450    </author>
4451    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
4452      <organization abbrev="W3C">World Wide Web Consortium</organization>
4453      <address><email></email></address>
4454    </author>
4455    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4456      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4457      <address><email></email></address>
4458    </author>
4459    <date month="February" year="2014"/>
4460  </front>
4461  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-26"/>
4465<reference anchor="Part6">
4466  <front>
4467    <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
4468    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4469      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4470      <address><email></email></address>
4471    </author>
4472    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
4473      <organization>Akamai</organization>
4474      <address><email></email></address>
4475    </author>
4476    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4477      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4478      <address><email></email></address>
4479    </author>
4480    <date month="February" year="2014"/>
4481  </front>
4482  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-26"/>
4486<reference anchor="Part7">
4487  <front>
4488    <title>Hypertext Transfer Protocol (HTTP/1.1): Authentication</title>
4489    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4490      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4491      <address><email></email></address>
4492    </author>
4493    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4494      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4495      <address><email></email></address>
4496    </author>
4497    <date month="February" year="2014"/>
4498  </front>
4499  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p7-auth-26"/>
4503<reference anchor="RFC5234">
4504  <front>
4505    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
4506    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
4507      <organization>Brandenburg InternetWorking</organization>
4508      <address>
4509        <email></email>
4510      </address> 
4511    </author>
4512    <author initials="P." surname="Overell" fullname="Paul Overell">
4513      <organization>THUS plc.</organization>
4514      <address>
4515        <email></email>
4516      </address>
4517    </author>
4518    <date month="January" year="2008"/>
4519  </front>
4520  <seriesInfo name="STD" value="68"/>
4521  <seriesInfo name="RFC" value="5234"/>
4524<reference anchor="RFC2119">
4525  <front>
4526    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
4527    <author initials="S." surname="Bradner" fullname="Scott Bradner">
4528      <organization>Harvard University</organization>
4529      <address><email></email></address>
4530    </author>
4531    <date month="March" year="1997"/>
4532  </front>
4533  <seriesInfo name="BCP" value="14"/>
4534  <seriesInfo name="RFC" value="2119"/>
4537<reference anchor="RFC3986">
4538 <front>
4539  <title abbrev="URI Generic Syntax">Uniform Resource Identifier (URI): Generic Syntax</title>
4540  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4541    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
4542    <address>
4543       <email></email>
4544       <uri></uri>
4545    </address>
4546  </author>
4547  <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
4548    <organization abbrev="Day Software">Day Software</organization>
4549    <address>
4550      <email></email>
4551      <uri></uri>
4552    </address>
4553  </author>
4554  <author initials="L." surname="Masinter" fullname="Larry Masinter">
4555    <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
4556    <address>
4557      <email></email>
4558      <uri></uri>
4559    </address>
4560  </author>
4561  <date month="January" year="2005"/>
4562 </front>
4563 <seriesInfo name="STD" value="66"/>
4564 <seriesInfo name="RFC" value="3986"/>
4567<reference anchor="RFC0793">
4568  <front>
4569    <title>Transmission Control Protocol</title>
4570    <author initials="J." surname="Postel" fullname="Jon Postel">
4571      <organization>University of Southern California (USC)/Information Sciences Institute</organization>
4572    </author>
4573    <date year="1981" month="September"/>
4574  </front>
4575  <seriesInfo name="STD" value="7"/>
4576  <seriesInfo name="RFC" value="793"/>
4579<reference anchor="USASCII">
4580  <front>
4581    <title>Coded Character Set -- 7-bit American Standard Code for Information Interchange</title>
4582    <author>
4583      <organization>American National Standards Institute</organization>
4584    </author>
4585    <date year="1986"/>
4586  </front>
4587  <seriesInfo name="ANSI" value="X3.4"/>
4590<reference anchor="RFC1950">
4591  <front>
4592    <title>ZLIB Compressed Data Format Specification version 3.3</title>
4593    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4594      <organization>Aladdin Enterprises</organization>
4595      <address><email></email></address>
4596    </author>
4597    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly"/>
4598    <date month="May" year="1996"/>
4599  </front>
4600  <seriesInfo name="RFC" value="1950"/>
4601  <!--<annotation>
4602    RFC 1950 is an Informational RFC, thus it might be less stable than
4603    this specification. On the other hand, this downward reference was
4604    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4605    therefore it is unlikely to cause problems in practice. See also
4606    <xref target="BCP97"/>.
4607  </annotation>-->
4610<reference anchor="RFC1951">
4611  <front>
4612    <title>DEFLATE Compressed Data Format Specification version 1.3</title>
4613    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4614      <organization>Aladdin Enterprises</organization>
4615      <address><email></email></address>
4616    </author>
4617    <date month="May" year="1996"/>
4618  </front>
4619  <seriesInfo name="RFC" value="1951"/>
4620  <!--<annotation>
4621    RFC 1951 is an Informational RFC, thus it might be less stable than
4622    this specification. On the other hand, this downward reference was
4623    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4624    therefore it is unlikely to cause problems in practice. See also
4625    <xref target="BCP97"/>.
4626  </annotation>-->
4629<reference anchor="RFC1952">
4630  <front>
4631    <title>GZIP file format specification version 4.3</title>
4632    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4633      <organization>Aladdin Enterprises</organization>
4634      <address><email></email></address>
4635    </author>
4636    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
4637      <address><email></email></address>
4638    </author>
4639    <author initials="M." surname="Adler" fullname="Mark Adler">
4640      <address><email></email></address>
4641    </author>
4642    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4643      <address><email></email></address>
4644    </author>
4645    <author initials="G." surname="Randers-Pehrson" fullname="Glenn Randers-Pehrson">
4646      <address><email></email></address>
4647    </author>
4648    <date month="May" year="1996"/>
4649  </front>
4650  <seriesInfo name="RFC" value="1952"/>
4651  <!--<annotation>
4652    RFC 1952 is an Informational RFC, thus it might be less stable than
4653    this specification. On the other hand, this downward reference was
4654    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4655    therefore it is unlikely to cause problems in practice. See also
4656    <xref target="BCP97"/>.
4657  </annotation>-->
4660<reference anchor="Welch">
4661  <front>
4662    <title>A Technique for High Performance Data Compression</title>
4663    <author initials="T.A." surname="Welch" fullname="Terry A. Welch"/>
4664    <date month="June" year="1984"/>
4665  </front>
4666  <seriesInfo name="IEEE Computer" value="17(6)"/>
4671<references title="Informative References">
4673<reference anchor="ISO-8859-1">
4674  <front>
4675    <title>
4676     Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1
4677    </title>
4678    <author>
4679      <organization>International Organization for Standardization</organization>
4680    </author>
4681    <date year="1998"/>
4682  </front>
4683  <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
4686<reference anchor="RFC1919">
4687  <front>
4688    <title>Classical versus Transparent IP Proxies</title>
4689    <author initials="M." surname="Chatel" fullname="Marc Chatel">
4690      <address><email></email></address>
4691    </author>
4692    <date year="1996" month="March"/>
4693  </front>
4694  <seriesInfo name="RFC" value="1919"/>
4697<reference anchor="RFC1945">
4698  <front>
4699    <title abbrev="HTTP/1.0">Hypertext Transfer Protocol -- HTTP/1.0</title>
4700    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4701      <organization>MIT, Laboratory for Computer Science</organization>
4702      <address><email></email></address>
4703    </author>
4704    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4705      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4706      <address><email></email></address>
4707    </author>
4708    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4709      <organization>W3 Consortium, MIT Laboratory for Computer Science</organization>
4710      <address><email></email></address>
4711    </author>
4712    <date month="May" year="1996"/>
4713  </front>
4714  <seriesInfo name="RFC" value="1945"/>
4717<reference anchor="RFC2045">
4718  <front>
4719    <title abbrev="Internet Message Bodies">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
4720    <author initials="N." surname="Freed" fullname="Ned Freed">
4721      <organization>Innosoft International, Inc.</organization>
4722      <address><email></email></address>
4723    </author>
4724    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
4725      <organization>First Virtual Holdings</organization>
4726      <address><email></email></address>
4727    </author>
4728    <date month="November" year="1996"/>
4729  </front>
4730  <seriesInfo name="RFC" value="2045"/>
4733<reference anchor="RFC2047">
4734  <front>
4735    <title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title>
4736    <author initials="K." surname="Moore" fullname="Keith Moore">
4737      <organization>University of Tennessee</organization>
4738      <address><email></email></address>
4739    </author>
4740    <date month="November" year="1996"/>
4741  </front>
4742  <seriesInfo name="RFC" value="2047"/>
4745<reference anchor="RFC2068">
4746  <front>
4747    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4748    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
4749      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4750      <address><email></email></address>
4751    </author>
4752    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4753      <organization>MIT Laboratory for Computer Science</organization>
4754      <address><email></email></address>
4755    </author>
4756    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
4757      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
4758      <address><email></email></address>
4759    </author>
4760    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4761      <organization>MIT Laboratory for Computer Science</organization>
4762      <address><email></email></address>
4763    </author>
4764    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4765      <organization>MIT Laboratory for Computer Science</organization>
4766      <address><email></email></address>
4767    </author>
4768    <date month="January" year="1997"/>
4769  </front>
4770  <seriesInfo name="RFC" value="2068"/>
4773<reference anchor="RFC2145">
4774  <front>
4775    <title abbrev="HTTP Version Numbers">Use and Interpretation of HTTP Version Numbers</title>
4776    <author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul">
4777      <organization>Western Research Laboratory</organization>
4778      <address><email></email></address>
4779    </author>
4780    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4781      <organization>Department of Information and Computer Science</organization>
4782      <address><email></email></address>
4783    </author>
4784    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4785      <organization>MIT Laboratory for Computer Science</organization>
4786      <address><email></email></address>
4787    </author>
4788    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4789      <organization>W3 Consortium</organization>
4790      <address><email></email></address>
4791    </author>
4792    <date month="May" year="1997"/>
4793  </front>
4794  <seriesInfo name="RFC" value="2145"/>
4797<reference anchor="RFC2616">
4798  <front>
4799    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4800    <author initials="R." surname="Fielding" fullname="R. Fielding">
4801      <organization>University of California, Irvine</organization>
4802      <address><email></email></address>
4803    </author>
4804    <author initials="J." surname="Gettys" fullname="J. Gettys">
4805      <organization>W3C</organization>
4806      <address><email></email></address>
4807    </author>
4808    <author initials="J." surname="Mogul" fullname="J. Mogul">
4809      <organization>Compaq Computer Corporation</organization>
4810      <address><email></email></address>
4811    </author>
4812    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
4813      <organization>MIT Laboratory for Computer Science</organization>
4814      <address><email></email></address>
4815    </author>
4816    <author initials="L." surname="Masinter" fullname="L. Masinter">
4817      <organization>Xerox Corporation</organization>
4818      <address><email></email></address>
4819    </author>
4820    <author initials="P." surname="Leach" fullname="P. Leach">
4821      <organization>Microsoft Corporation</organization>
4822      <address><email></email></address>
4823    </author>
4824    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
4825      <organization>W3C</organization>
4826      <address><email></email></address>
4827    </author>
4828    <date month="June" year="1999"/>
4829  </front>
4830  <seriesInfo name="RFC" value="2616"/>
4833<reference anchor="RFC2817">
4834  <front>
4835    <title>Upgrading to TLS Within HTTP/1.1</title>
4836    <author initials="R." surname="Khare" fullname="R. Khare">
4837      <organization>4K Associates / UC Irvine</organization>
4838      <address><email></email></address>
4839    </author>
4840    <author initials="S." surname="Lawrence" fullname="S. Lawrence">
4841      <organization>Agranat Systems, Inc.</organization>
4842      <address><email></email></address>
4843    </author>
4844    <date year="2000" month="May"/>
4845  </front>
4846  <seriesInfo name="RFC" value="2817"/>
4849<reference anchor="RFC2818">
4850  <front>
4851    <title>HTTP Over TLS</title>
4852    <author initials="E." surname="Rescorla" fullname="Eric Rescorla">
4853      <organization>RTFM, Inc.</organization>
4854      <address><email></email></address>
4855    </author>
4856    <date year="2000" month="May"/>
4857  </front>
4858  <seriesInfo name="RFC" value="2818"/>
4861<reference anchor="RFC3040">
4862  <front>
4863    <title>Internet Web Replication and Caching Taxonomy</title>
4864    <author initials="I." surname="Cooper" fullname="I. Cooper">
4865      <organization>Equinix, Inc.</organization>
4866    </author>
4867    <author initials="I." surname="Melve" fullname="I. Melve">
4868      <organization>UNINETT</organization>
4869    </author>
4870    <author initials="G." surname="Tomlinson" fullname="G. Tomlinson">
4871      <organization>CacheFlow Inc.</organization>
4872    </author>
4873    <date year="2001" month="January"/>
4874  </front>
4875  <seriesInfo name="RFC" value="3040"/>
4878<reference anchor="BCP90">
4879  <front>
4880    <title>Registration Procedures for Message Header Fields</title>
4881    <author initials="G." surname="Klyne" fullname="G. Klyne">
4882      <organization>Nine by Nine</organization>
4883      <address><email></email></address>
4884    </author>
4885    <author initials="M." surname="Nottingham" fullname="M. Nottingham">
4886      <organization>BEA Systems</organization>
4887      <address><email></email></address>
4888    </author>
4889    <author initials="J." surname="Mogul" fullname="J. Mogul">
4890      <organization>HP Labs</organization>
4891      <address><email></email></address>
4892    </author>
4893    <date year="2004" month="September"/>
4894  </front>
4895  <seriesInfo name="BCP" value="90"/>
4896  <seriesInfo name="RFC" value="3864"/>
4899<reference anchor="RFC4033">
4900  <front>
4901    <title>DNS Security Introduction and Requirements</title>
4902    <author initials="R." surname="Arends" fullname="R. Arends"/>
4903    <author initials="R." surname="Austein" fullname="R. Austein"/>
4904    <author initials="M." surname="Larson" fullname="M. Larson"/>
4905    <author initials="D." surname="Massey" fullname="D. Massey"/>
4906    <author initials="S." surname="Rose" fullname="S. Rose"/>
4907    <date year="2005" month="March"/>
4908  </front>
4909  <seriesInfo name="RFC" value="4033"/>
4912<reference anchor="BCP13">
4913  <front>
4914    <title>Media Type Specifications and Registration Procedures</title>
4915    <author initials="N." surname="Freed" fullname="Ned Freed">
4916      <organization>Oracle</organization>
4917      <address>
4918        <email></email>
4919      </address>
4920    </author>
4921    <author initials="J." surname="Klensin" fullname="John C. Klensin">
4922      <address>
4923        <email></email>
4924      </address>
4925    </author>
4926    <author initials="T." surname="Hansen" fullname="Tony Hansen">
4927      <organization>AT&amp;T Laboratories</organization>
4928      <address>
4929        <email></email>
4930      </address>
4931    </author>
4932    <date year="2013" month="January"/>
4933  </front>
4934  <seriesInfo name="BCP" value="13"/>
4935  <seriesInfo name="RFC" value="6838"/>
4938<reference anchor="BCP115">
4939  <front>
4940    <title>Guidelines and Registration Procedures for New URI Schemes</title>
4941    <author initials="T." surname="Hansen" fullname="T. Hansen">
4942      <organization>AT&amp;T Laboratories</organization>
4943      <address>
4944        <email></email>
4945      </address>
4946    </author>
4947    <author initials="T." surname="Hardie" fullname="T. Hardie">
4948      <organization>Qualcomm, Inc.</organization>
4949      <address>
4950        <email></email>
4951      </address>
4952    </author>
4953    <author initials="L." surname="Masinter" fullname="L. Masinter">
4954      <organization>Adobe Systems</organization>
4955      <address>
4956        <email></email>
4957      </address>
4958    </author>
4959    <date year="2006" month="February"/>
4960  </front>
4961  <seriesInfo name="BCP" value="115"/>
4962  <seriesInfo name="RFC" value="4395"/>
4965<reference anchor="RFC4559">
4966  <front>
4967    <title>SPNEGO-based Kerberos and NTLM HTTP Authentication in Microsoft Windows</title>
4968    <author initials="K." surname="Jaganathan" fullname="K. Jaganathan"/>
4969    <author initials="L." surname="Zhu" fullname="L. Zhu"/>
4970    <author initials="J." surname="Brezak" fullname="J. Brezak"/>
4971    <date year="2006" month="June"/>
4972  </front>
4973  <seriesInfo name="RFC" value="4559"/>
4976<reference anchor="RFC5226">
4977  <front>
4978    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
4979    <author initials="T." surname="Narten" fullname="T. Narten">
4980      <organization>IBM</organization>
4981      <address><email></email></address>
4982    </author>
4983    <author initials="H." surname="Alvestrand" fullname="H. Alvestrand">
4984      <organization>Google</organization>
4985      <address><email></email></address>
4986    </author>
4987    <date year="2008" month="May"/>
4988  </front>
4989  <seriesInfo name="BCP" value="26"/>
4990  <seriesInfo name="RFC" value="5226"/>
4993<reference anchor="RFC5246">
4994   <front>
4995      <title>The Transport Layer Security (TLS) Protocol Version 1.2</title>
4996      <author initials="T." surname="Dierks" fullname="T. Dierks"/>
4997      <author initials="E." surname="Rescorla" fullname="E. Rescorla">
4998         <organization>RTFM, Inc.</organization>
4999      </author>
5000      <date year="2008" month="August"/>
5001   </front>
5002   <seriesInfo name="RFC" value="5246"/>
5005<reference anchor="RFC5322">
5006  <front>
5007    <title>Internet Message Format</title>
5008    <author initials="P." surname="Resnick" fullname="P. Resnick">
5009      <organization>Qualcomm Incorporated</organization>
5010    </author>
5011    <date year="2008" month="October"/>
5012  </front>
5013  <seriesInfo name="RFC" value="5322"/>
5016<reference anchor="RFC6265">
5017  <front>
5018    <title>HTTP State Management Mechanism</title>
5019    <author initials="A." surname="Barth" fullname="Adam Barth">
5020      <organization abbrev="U.C. Berkeley">
5021        University of California, Berkeley
5022      </organization>
5023      <address><email></email></address>
5024    </author>
5025    <date year="2011" month="April"/>
5026  </front>
5027  <seriesInfo name="RFC" value="6265"/>
5030<reference anchor="RFC6585">
5031  <front>
5032    <title>Additional HTTP Status Codes</title>
5033    <author initials="M." surname="Nottingham" fullname="M. Nottingham">
5034      <organization>Rackspace</organization>
5035    </author>
5036    <author initials="R." surname="Fielding" fullname="R. Fielding">
5037      <organization>Adobe</organization>
5038    </author>
5039    <date year="2012" month="April"/>
5040   </front>
5041   <seriesInfo name="RFC" value="6585"/>
5044<!--<reference anchor='BCP97'>
5045  <front>
5046    <title>Handling Normative References to Standards-Track Documents</title>
5047    <author initials='J.' surname='Klensin' fullname='J. Klensin'>
5048      <address>
5049        <email></email>
5050      </address>
5051    </author>
5052    <author initials='S.' surname='Hartman' fullname='S. Hartman'>
5053      <organization>MIT</organization>
5054      <address>
5055        <email></email>
5056      </address>
5057    </author>
5058    <date year='2007' month='June' />
5059  </front>
5060  <seriesInfo name='BCP' value='97' />
5061  <seriesInfo name='RFC' value='4897' />
5064<reference anchor="Kri2001" target="">
5065  <front>
5066    <title>HTTP Cookies: Standards, Privacy, and Politics</title>
5067    <author initials="D." surname="Kristol" fullname="David M. Kristol"/>
5068    <date year="2001" month="November"/>
5069  </front>
5070  <seriesInfo name="ACM Transactions on Internet Technology" value="1(2)"/>
5073<reference anchor="Klein" target="">
5074  <front>
5075    <title>Divide and Conquer - HTTP Response Splitting, Web Cache Poisoning Attacks, and Related Topics</title>
5076    <author initials="A." surname="Klein" fullname="Amit Klein">
5077      <organization>Sanctum, Inc.</organization>
5078    </author>
5079    <date year="2004" month="March"/>
5080  </front>
5083<reference anchor="Georgiev" target="">
5084  <front>
5085    <title>The Most Dangerous Code in the World: Validating SSL Certificates in Non-browser Software</title>
5086    <author initials="M." surname="Georgiev" fullname="Martin Georgiev"/>
5087    <author initials="S." surname="Iyengar" fullname="Subodh Iyengar"/>
5088    <author initials="S." surname="Jana" fullname="Suman Jana"/>
5089    <author initials="R." surname="Anubhai" fullname="Rishita Anubhai"/>
5090    <author initials="D." surname="Boneh" fullname="Dan Boneh"/>
5091    <author initials="V." surname="Shmatikov" fullname="Vitaly Shmatikov"/>
5092    <date year="2012" month="October"/>
5093  </front>
5094  <!--Converted from rfc2629.xslt x:prose extension--><seriesInfo name="In" value="Proceedings of the 2012 ACM Conference on Computer and Communications Security (CCS '12), pp. 38-49"/>
5097<reference anchor="Linhart" target="">
5098  <front>
5099    <title>HTTP Request Smuggling</title>
5100    <author initials="C." surname="Linhart" fullname="Chaim Linhart"/>
5101    <author initials="A." surname="Klein" fullname="Amit Klein"/>
5102    <author initials="R." surname="Heled" fullname="Ronen Heled"/>
5103    <author initials="S." surname="Orrin" fullname="Steve Orrin"/>
5104    <date year="2005" month="June"/>
5105  </front>
5111<section title="HTTP Version History" anchor="compatibility">
5113   HTTP has been in use since 1990. The first version, later referred to as
5114   HTTP/0.9, was a simple protocol for hypertext data transfer across the
5115   Internet, using only a single request method (GET) and no metadata.
5116   HTTP/1.0, as defined by <xref target="RFC1945"/>, added a range of request
5117   methods and MIME-like messaging, allowing for metadata to be transferred
5118   and modifiers placed on the request/response semantics. However,
5119   HTTP/1.0 did not sufficiently take into consideration the effects of
5120   hierarchical proxies, caching, the need for persistent connections, or
5121   name-based virtual hosts. The proliferation of incompletely-implemented
5122   applications calling themselves "HTTP/1.0" further necessitated a
5123   protocol version change in order for two communicating applications
5124   to determine each other's true capabilities.
5127   HTTP/1.1 remains compatible with HTTP/1.0 by including more stringent
5128   requirements that enable reliable implementations, adding only
5129   those features that can either be safely ignored by an HTTP/1.0
5130   recipient or only sent when communicating with a party advertising
5131   conformance with HTTP/1.1.
5134   HTTP/1.1 has been designed to make supporting previous versions easy.
5135   A general-purpose HTTP/1.1 server ought to be able to understand any valid
5136   request in the format of HTTP/1.0, responding appropriately with an
5137   HTTP/1.1 message that only uses features understood (or safely ignored) by
5138   HTTP/1.0 clients. Likewise, an HTTP/1.1 client can be expected to
5139   understand any valid HTTP/1.0 response.
5142   Since HTTP/0.9 did not support header fields in a request, there is no
5143   mechanism for it to support name-based virtual hosts (selection of resource
5144   by inspection of the <xref target="" format="none">Host</xref> header field).
5145   Any server that implements name-based virtual hosts ought to disable
5146   support for HTTP/0.9. Most requests that appear to be HTTP/0.9 are, in
5147   fact, badly constructed HTTP/1.x requests caused by a client failing to
5148   properly encode the request-target.
5151<section title="Changes from HTTP/1.0" anchor="changes.from.1.0">
5153   This section summarizes major differences between versions HTTP/1.0
5154   and HTTP/1.1.
5157<section title="Multi-homed Web Servers" anchor="">
5159   The requirements that clients and servers support the <xref target="" format="none">Host</xref>
5160   header field (<xref target=""/>), report an error if it is
5161   missing from an HTTP/1.1 request, and accept absolute URIs (<xref target="request-target"/>)
5162   are among the most important changes defined by HTTP/1.1.
5165   Older HTTP/1.0 clients assumed a one-to-one relationship of IP
5166   addresses and servers; there was no other established mechanism for
5167   distinguishing the intended server of a request than the IP address
5168   to which that request was directed. The <xref target="" format="none">Host</xref> header field was
5169   introduced during the development of HTTP/1.1 and, though it was
5170   quickly implemented by most HTTP/1.0 browsers, additional requirements
5171   were placed on all HTTP/1.1 requests in order to ensure complete
5172   adoption.  At the time of this writing, most HTTP-based services
5173   are dependent upon the Host header field for targeting requests.
5177<section title="Keep-Alive Connections" anchor="compatibility.with.http.1.0.persistent.connections">
5179   In HTTP/1.0, each connection is established by the client prior to the
5180   request and closed by the server after sending the response. However, some
5181   implementations implement the explicitly negotiated ("Keep-Alive") version
5182   of persistent connections described in Section 19.7.1 of <xref target="RFC2068"/>.
5185   Some clients and servers might wish to be compatible with these previous
5186   approaches to persistent connections, by explicitly negotiating for them
5187   with a "Connection: keep-alive" request header field. However, some
5188   experimental implementations of HTTP/1.0 persistent connections are faulty;
5189   for example, if an HTTP/1.0 proxy server doesn't understand
5190   <xref target="header.connection" format="none">Connection</xref>, it will erroneously forward that header field
5191   to the next inbound server, which would result in a hung connection.
5194   One attempted solution was the introduction of a Proxy-Connection header
5195   field, targeted specifically at proxies. In practice, this was also
5196   unworkable, because proxies are often deployed in multiple layers, bringing
5197   about the same problem discussed above.
5200   As a result, clients are encouraged not to send the Proxy-Connection header
5201   field in any requests.
5204   Clients are also encouraged to consider the use of Connection: keep-alive
5205   in requests carefully; while they can enable persistent connections with
5206   HTTP/1.0 servers, clients using them will need to monitor the
5207   connection for "hung" requests (which indicate that the client ought stop
5208   sending the header field), and this mechanism ought not be used by clients
5209   at all when a proxy is being used.
5213<section title="Introduction of Transfer-Encoding" anchor="introduction.of.transfer-encoding">
5215   HTTP/1.1 introduces the <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field
5216   (<xref target="header.transfer-encoding"/>).
5217   Transfer codings need to be decoded prior to forwarding an HTTP message
5218   over a MIME-compliant protocol.
5224<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
5226  HTTP's approach to error handling has been explained.
5227  (<xref target="conformance"/>)
5230  The HTTP-version ABNF production has been clarified to be case-sensitive.
5231  Additionally, version numbers has been restricted to single digits, due
5232  to the fact that implementations are known to handle multi-digit version
5233  numbers incorrectly.
5234  (<xref target="http.version"/>)
5237  Userinfo (i.e., username and password) are now disallowed in HTTP and
5238  HTTPS URIs, because of security issues related to their transmission on the
5239  wire.
5240  (<xref target="http.uri"/>)
5243  The HTTPS URI scheme is now defined by this specification; previously,
5244  it was done in  Section 2.4 of <xref target="RFC2818"/>.
5245  Furthermore, it implies end-to-end security.
5246  (<xref target="https.uri"/>)
5249  HTTP messages can be (and often are) buffered by implementations; despite
5250  it sometimes being available as a stream, HTTP is fundamentally a
5251  message-oriented protocol.
5252  Minimum supported sizes for various protocol elements have been
5253  suggested, to improve interoperability.
5254  (<xref target="http.message"/>)
5257  Invalid whitespace around field-names is now required to be rejected,
5258  because accepting it represents a security vulnerability.
5259  The ABNF productions defining header fields now only list the field value.
5260  (<xref target="header.fields"/>)
5263  Rules about implicit linear whitespace between certain grammar productions
5264  have been removed; now whitespace is only allowed where specifically
5265  defined in the ABNF.
5266  (<xref target="whitespace"/>)
5269  Header fields that span multiple lines ("line folding") are deprecated.
5270  (<xref target="field.parsing"/>)
5273  The NUL octet is no longer allowed in comment and quoted-string text, and
5274  handling of backslash-escaping in them has been clarified.
5275  The quoted-pair rule no longer allows escaping control characters other than
5276  HTAB.
5277  Non-ASCII content in header fields and the reason phrase has been obsoleted
5278  and made opaque (the TEXT rule was removed).
5279  (<xref target="field.components"/>)
5282  Bogus "<xref target="header.content-length" format="none">Content-Length</xref>" header fields are now required to be
5283  handled as errors by recipients.
5284  (<xref target="header.content-length"/>)
5287  The algorithm for determining the message body length has been clarified
5288  to indicate all of the special cases (e.g., driven by methods or status
5289  codes) that affect it, and that new protocol elements cannot define such
5290  special cases.
5291  CONNECT is a new, special case in determining message body length.
5292  "multipart/byteranges" is no longer a way of determining message body length
5293  detection.
5294  (<xref target="message.body.length"/>)
5297  The "identity" transfer coding token has been removed.
5298  (Sections <xref format="counter" target="message.body"/> and
5299  <xref format="counter" target="transfer.codings"/>)
5302  Chunk length does not include the count of the octets in the
5303  chunk header and trailer.
5304  Line folding in chunk extensions is  disallowed.
5305  (<xref target="chunked.encoding"/>)
5308  The meaning of the "deflate" content coding has been clarified.
5309  (<xref target="deflate.coding"/>)
5312  The segment + query components of RFC 3986 have been used to define the
5313  request-target, instead of abs_path from RFC 1808.
5314  The asterisk-form of the request-target is only allowed with the OPTIONS
5315  method.
5316  (<xref target="request-target"/>)
5319  The term "Effective Request URI" has been introduced.
5320  (<xref target="effective.request.uri"/>)
5323  Gateways do not need to generate <xref target="header.via" format="none">Via</xref> header fields anymore.
5324  (<xref target="header.via"/>)
5327  Exactly when "close" connection options have to be sent has been clarified.
5328  Also, "hop-by-hop" header fields are required to appear in the Connection header
5329  field; just because they're defined as hop-by-hop in this specification
5330  doesn't exempt them.
5331  (<xref target="header.connection"/>)
5334  The limit of two connections per server has been removed.
5335  An idempotent sequence of requests is no longer required to be retried.
5336  The requirement to retry requests under certain circumstances when the
5337  server prematurely closes the connection has been removed.
5338  Also, some extraneous requirements about when servers are allowed to close
5339  connections prematurely have been removed.
5340  (<xref target="persistent.connections"/>)
5343  The semantics of the <xref target="header.upgrade" format="none">Upgrade</xref> header field is now defined in
5344  responses other than 101 (this was incorporated from <xref target="RFC2817"/>). Furthermore, the ordering in the field value is now
5345  significant.
5346  (<xref target="header.upgrade"/>)
5349  Empty list elements in list productions (e.g., a list header field containing
5350  ", ,") have been deprecated.
5351  (<xref target="abnf.extension"/>)
5354  Registration of Transfer Codings now requires IETF Review
5355  (<xref target="transfer.coding.registry"/>)
5358  This specification now defines the Upgrade Token Registry, previously
5359  defined in Section 7.2 of <xref target="RFC2817"/>.
5360  (<xref target="upgrade.token.registry"/>)
5363  The expectation to support HTTP/0.9 requests has been removed.
5364  (<xref target="compatibility"/>)
5367  Issues with the Keep-Alive and Proxy-Connection header fields in requests
5368  are pointed out, with use of the latter being discouraged altogether.
5369  (<xref target="compatibility.with.http.1.0.persistent.connections"/>)
5375<section title="Collected ABNF" anchor="collected.abnf">
5377<artwork type="abnf" name="p1-messaging.parsed-abnf"><![CDATA[
5378BWS = OWS
5380Connection = *( "," OWS ) connection-option *( OWS "," [ OWS
5381 connection-option ] )
5382Content-Length = 1*DIGIT
5384HTTP-message = start-line *( header-field CRLF ) CRLF [ message-body
5385 ]
5386HTTP-name = %x48.54.54.50 ; HTTP
5387HTTP-version = HTTP-name "/" DIGIT "." DIGIT
5388Host = uri-host [ ":" port ]
5390OWS = *( SP / HTAB )
5392RWS = 1*( SP / HTAB )
5394TE = [ ( "," / t-codings ) *( OWS "," [ OWS t-codings ] ) ]
5395Trailer = *( "," OWS ) field-name *( OWS "," [ OWS field-name ] )
5396Transfer-Encoding = *( "," OWS ) transfer-coding *( OWS "," [ OWS
5397 transfer-coding ] )
5399URI-reference = <URI-reference, defined in [RFC3986], Section 4.1>
5400Upgrade = *( "," OWS ) protocol *( OWS "," [ OWS protocol ] )
5402Via = *( "," OWS ) ( received-protocol RWS received-by [ RWS comment
5403 ] ) *( OWS "," [ OWS ( received-protocol RWS received-by [ RWS
5404 comment ] ) ] )
5406absolute-URI = <absolute-URI, defined in [RFC3986], Section 4.3>
5407absolute-form = absolute-URI
5408absolute-path = 1*( "/" segment )
5409asterisk-form = "*"
5410authority = <authority, defined in [RFC3986], Section 3.2>
5411authority-form = authority
5413chunk = chunk-size [ chunk-ext ] CRLF chunk-data CRLF
5414chunk-data = 1*OCTET
5415chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
5416chunk-ext-name = token
5417chunk-ext-val = token / quoted-string
5418chunk-size = 1*HEXDIG
5419chunked-body = *chunk last-chunk trailer-part CRLF
5420comment = "(" *( ctext / quoted-pair / comment ) ")"
5421connection-option = token
5422ctext = HTAB / SP / %x21-27 ; '!'-'''
5423 / %x2A-5B ; '*'-'['
5424 / %x5D-7E ; ']'-'~'
5425 / obs-text
5427field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
5428field-name = token
5429field-value = *( field-content / obs-fold )
5430field-vchar = VCHAR / obs-text
5431fragment = <fragment, defined in [RFC3986], Section 3.5>
5433header-field = field-name ":" OWS field-value OWS
5434http-URI = "http://" authority path-abempty [ "?" query ] [ "#"
5435 fragment ]
5436https-URI = "https://" authority path-abempty [ "?" query ] [ "#"
5437 fragment ]
5439last-chunk = 1*"0" [ chunk-ext ] CRLF
5441message-body = *OCTET
5442method = token
5444obs-fold = CRLF 1*( SP / HTAB )
5445obs-text = %x80-FF
5446origin-form = absolute-path [ "?" query ]
5448partial-URI = relative-part [ "?" query ]
5449path-abempty = <path-abempty, defined in [RFC3986], Section 3.3>
5450port = <port, defined in [RFC3986], Section 3.2.3>
5451protocol = protocol-name [ "/" protocol-version ]
5452protocol-name = token
5453protocol-version = token
5454pseudonym = token
5456qdtext = HTAB / SP / "!" / %x23-5B ; '#'-'['
5457 / %x5D-7E ; ']'-'~'
5458 / obs-text
5459query = <query, defined in [RFC3986], Section 3.4>
5460quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
5461quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
5463rank = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] )
5464reason-phrase = *( HTAB / SP / VCHAR / obs-text )
5465received-by = ( uri-host [ ":" port ] ) / pseudonym
5466received-protocol = [ protocol-name "/" ] protocol-version
5467relative-part = <relative-part, defined in [RFC3986], Section 4.2>
5468request-line = method SP request-target SP HTTP-version CRLF
5469request-target = origin-form / absolute-form / authority-form /
5470 asterisk-form
5472scheme = <scheme, defined in [RFC3986], Section 3.1>
5473segment = <segment, defined in [RFC3986], Section 3.3>
5474start-line = request-line / status-line
5475status-code = 3DIGIT
5476status-line = HTTP-version SP status-code SP reason-phrase CRLF
5478t-codings = "trailers" / ( transfer-coding [ t-ranking ] )
5479t-ranking = OWS ";" OWS "q=" rank
5480tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
5481 "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
5482token = 1*tchar
5483trailer-part = *( header-field CRLF )
5484transfer-coding = "chunked" / "compress" / "deflate" / "gzip" /
5485 transfer-extension
5486transfer-extension = token *( OWS ";" OWS transfer-parameter )
5487transfer-parameter = token BWS "=" BWS ( token / quoted-string )
5489uri-host = <host, defined in [RFC3986], Section 3.2.2>
5495<section title="Change Log (to be removed by RFC Editor before publication)" anchor="change.log">
5497<section title="Since RFC 2616">
5499  Changes up to the IETF Last Call draft are summarized
5500  in <eref target=""/>.
5504<section title="Since draft-ietf-httpbis-p1-messaging-24" anchor="changes.since.24">
5506  Closed issues:
5507  <list style="symbols">
5508    <t>
5509      <eref target=""/>:
5510      "APPSDIR review of draft-ietf-httpbis-p1-messaging-24"
5511    </t>
5512    <t>
5513      <eref target=""/>:
5514      "integer value parsing"
5515    </t>
5516    <t>
5517      <eref target=""/>:
5518      "move IANA registrations to correct draft"
5519    </t>
5520  </list>
5524<section title="Since draft-ietf-httpbis-p1-messaging-25" anchor="changes.since.25">
5526  Closed issues:
5527  <list style="symbols">
5528    <t>
5529      <eref target=""/>:
5530      "check media type registration templates"
5531    </t>
5532    <t>
5533      <eref target=""/>:
5534      "Redundant rule quoted-str-nf"
5535    </t>
5536    <t>
5537      <eref target=""/>:
5538      "add 'stateless' to Abstract"
5539    </t>
5540    <t>
5541      <eref target=""/>:
5542      "clarify ABNF layering"
5543    </t>
5544    <t>
5545      <eref target=""/>:
5546      "use of 'word' ABNF production"
5547    </t>
5548    <t>
5549      <eref target=""/>:
5550      "improve introduction of list rule"
5551    </t>
5552    <t>
5553      <eref target=""/>:
5554      "moving 2616/2068/2145 to historic"
5555    </t>
5556    <t>
5557      <eref target=""/>:
5558      "augment security considerations with pointers to current research"
5559    </t>
5560    <t>
5561      <eref target=""/>:
5562      "intermediaries handling trailers"
5563    </t>
5564    <t>
5565      <eref target=""/>:
5566      "allow privacy proxies to be conformant"
5567    </t>
5568  </list>
5571  Partly resolved issues:
5572  <list style="symbols">
5573    <t>
5574      <eref target=""/>:
5575      "IESG ballot on draft-ietf-httpbis-p1-messaging-25"
5576    </t>
5577  </list>
Note: See TracBrowser for help on using the repository browser.