source: draft-ietf-httpbis/latest/auth48/rfc7230-to-be.xml @ 2705

Last change on this file since 2705 was 2700, checked in by julian.reschke@…, 6 years ago

updated AUTH48 versions of RFC7230 and RFC7235 (#553)

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 226.6 KB
1<?xml version="1.0" encoding="US-ASCII"?>
3<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
4<?rfc toc="yes" ?>
5<?rfc symrefs="yes" ?>
6<?rfc sortrefs="yes" ?>
7<?rfc compact="yes"?>
8<?rfc subcompact="no" ?>
9<?rfc linkmailto="no" ?>
10<?rfc editing="no" ?>
11<?rfc comments="yes"?>
12<?rfc inline="yes"?>
13<?rfc rfcedstyle="yes"?>
14<!DOCTYPE rfc
15  PUBLIC "" "rfc2629.dtd">
17<rfc submissionType="IETF" obsoletes="2145, 2616" updates="2817, 2818" category="std" consensus="yes" ipr="pre5378Trust200902" number="7230">
19<!-- [rfced] Please note that xml2rfc v2 is not producing the Index correctly
20at this time.  We have switched to v1 per the request of the authors.  -->
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="May" year="2014"/>
56  <area>Applications</area>
57  <workgroup>HTTPbis Working Group</workgroup>
59  <keyword>Hypertext Transfer Protocol</keyword>
60  <keyword>HTTP</keyword>
61  <keyword>HTTP message format</keyword>
65   The Hypertext Transfer Protocol (HTTP) is a stateless application-level
66   protocol for distributed, collaborative, hypertext information systems.
67   This document provides an overview of HTTP architecture and its associated
68   terminology, defines the "http" and "https" Uniform Resource Identifier
69   (URI) schemes, defines the HTTP/1.1 message syntax and parsing
70   requirements, and describes related security concerns for implementations.
77<section title="Introduction" anchor="introduction">
79   The Hypertext Transfer Protocol (HTTP) is a stateless application-level
80   request/response protocol that uses extensible semantics and
81   self-descriptive message payloads for flexible interaction with
82   network-based hypertext information systems. This document is the first in
83   a series of documents that collectively form the HTTP/1.1 specification:
84   <list style="numbers">
85    <t>"Message Syntax and Routing" (this document)</t>
86    <t>"Semantics and Content" <xref target="RFC7231"/></t>
87    <t>"Conditional Requests" <xref target="RFC7232"/></t>
88    <t>"Range Requests" <xref target="RFC7233"/></t>
89    <t>"Caching" <xref target="RFC7234"/></t>
90    <t>"Authentication" <xref target="RFC7235"/></t>
91   </list>
94   This HTTP/1.1 specification obsoletes
95   RFC 2616 and
96   RFC 2145 (on HTTP versioning).
97   This specification also updates the use of CONNECT to establish a tunnel,
98   previously defined in RFC 2817,
99   and defines the "https" URI scheme that was described informally in
100   RFC 2818.
103   HTTP is a generic interface protocol for information systems. It is
104   designed to hide the details of how a service is implemented by presenting
105   a uniform interface to clients that is independent of the types of
106   resources provided. Likewise, servers do not need to be aware of each
107   client's purpose: an HTTP request can be considered in isolation rather
108   than being associated with a specific type of client or a predetermined
109   sequence of application steps. The result is a protocol that can be used
110   effectively in many different contexts and for which implementations can
111   evolve independently over time.
114   HTTP is also designed for use as an intermediation protocol for translating
115   communication to and from non-HTTP information systems.
116   HTTP proxies and gateways can provide access to alternative information
117   services by translating their diverse protocols into a hypertext
118   format that can be viewed and manipulated by clients in the same way
119   as HTTP services.
122   One consequence of this flexibility is that the protocol cannot be
123   defined in terms of what occurs behind the interface. Instead, we
124   are limited to defining the syntax of communication, the intent
125   of received communication, and the expected behavior of recipients.
126   If the communication is considered in isolation, then successful
127   actions ought to be reflected in corresponding changes to the
128   observable interface provided by servers. However, since multiple
129   clients might act in parallel and perhaps at cross-purposes, we
130   cannot require that such changes be observable beyond the scope
131   of a single response.
134   This document describes the architectural elements that are used or
135   referred to in HTTP, defines the "http" and "https" URI schemes,
136   describes overall network operation and connection management,
137   and defines HTTP message framing and forwarding requirements.
138   Our goal is to define all of the mechanisms necessary for HTTP message
139   handling that are independent of message semantics, thereby defining the
140   complete set of requirements for message parsers and
141   message-forwarding intermediaries.
145<section title="Requirements Notation" anchor="intro.requirements">
147   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
148   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
149   document are to be interpreted as described in <xref target="RFC2119"/>.
152   Conformance criteria and considerations regarding error handling
153   are defined in <xref target="conformance"/>.
157<section title="Syntax Notation" anchor="notation">
158<iref primary="true" item="Grammar" subitem="ALPHA"/>
159<iref primary="true" item="Grammar" subitem="CR"/>
160<iref primary="true" item="Grammar" subitem="CRLF"/>
161<iref primary="true" item="Grammar" subitem="CTL"/>
162<iref primary="true" item="Grammar" subitem="DIGIT"/>
163<iref primary="true" item="Grammar" subitem="DQUOTE"/>
164<iref primary="true" item="Grammar" subitem="HEXDIG"/>
165<iref primary="true" item="Grammar" subitem="HTAB"/>
166<iref primary="true" item="Grammar" subitem="LF"/>
167<iref primary="true" item="Grammar" subitem="OCTET"/>
168<iref primary="true" item="Grammar" subitem="SP"/>
169<iref primary="true" item="Grammar" subitem="VCHAR"/>
171   This specification uses the Augmented Backus-Naur Form (ABNF) notation of
172   <xref target="RFC5234"/> with a list extension, defined in
173   <xref target="abnf.extension"/>, that allows for compact definition of
174   comma-separated lists using a '#' operator (similar to how the '*' operator
175   indicates repetition).
176   <xref target="collected.abnf"/> shows the collected grammar with all list
177   operators expanded to standard ABNF notation.
179<t anchor="core.rules">
192   The following core rules are included by
193   reference, as defined in <xref target="RFC5234"/>, Appendix B.1:
194   ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
195   DIGIT (decimal 0-9), DQUOTE (double quote),
196   HEXDIG (hexadecimal 0-9/A-F/a-f), HTAB (horizontal tab), LF (line feed),
197   OCTET (any 8-bit sequence of data), SP (space), and
198   VCHAR (any visible <xref target="USASCII"/> character).
201   As a convention, ABNF rule names prefixed with "obs-" denote
202   "obsolete" grammar rules that appear for historical reasons.
207<section title="Architecture" anchor="architecture">
209   HTTP was created for the World Wide Web (WWW) architecture
210   and has evolved over time to support the scalability needs of a worldwide
211   hypertext system. Much of that architecture is reflected in the terminology
212   and syntax productions used to define HTTP.
215<section title="Client/Server Messaging" anchor="operation">
216<iref primary="true" item="client"/>
217<iref primary="true" item="server"/>
218<iref primary="true" item="connection"/>
220   HTTP is a stateless request/response protocol that operates by exchanging
221   messages (<xref target="http.message"/>) across a reliable
222   transport- or session-layer
223   "connection" (<xref target=""/>).
224   An HTTP "client" is a program that establishes a connection
225   to a server for the purpose of sending one or more HTTP requests.
226   An HTTP "server" is a program that accepts connections
227   in order to service HTTP requests by sending HTTP responses.
229<iref primary="true" item="user agent"/>
230<iref primary="true" item="origin server"/>
231<iref primary="true" item="browser"/>
232<iref primary="true" item="spider"/>
233<iref primary="true" item="sender"/>
234<iref primary="true" item="recipient"/>
236   The terms "client" and "server" refer only to the roles that
237   these programs perform for a particular connection.  The same program
238   might act as a client on some connections and a server on others.
239   The term "user agent" refers to any of the various
240   client programs that initiate a request, including (but not limited to)
241   browsers, spiders (web-based robots), command-line tools, custom
242   applications, and mobile apps.
243   The term "origin server" refers to the program that can
244   originate authoritative responses for a given target resource.
245   The terms "sender" and "recipient" refer to
246   any implementation that sends or receives a given message, respectively.
249   HTTP relies upon the Uniform Resource Identifier (URI)
250   standard <xref target="RFC3986"/> to indicate the target resource
251   (<xref target="target-resource"/>) and relationships between resources.
252   Messages are passed in a format similar to that used by Internet mail
253   <xref target="RFC5322"/> and the Multipurpose Internet Mail Extensions
254   (MIME) <xref target="RFC2045"/> (see Appendix A of <xref target="RFC7231"/> for the differences
255   between HTTP and MIME messages).
258   Most HTTP communication consists of a retrieval request (GET) for
259   a representation of some resource identified by a URI.  In the
260   simplest case, this might be accomplished via a single bidirectional
261   connection (===) between the user agent (UA) and the origin server (O).
263<figure><artwork type="drawing"><![CDATA[
264         request   >
265    UA ======================================= O
266                                <   response
268<iref primary="true" item="message"/>
269<iref primary="true" item="request"/>
270<iref primary="true" item="response"/>
272   A client sends an HTTP request to a server in the form of a request
273   message, beginning with a request-line that includes a method, URI, and
274   protocol version (<xref target="request.line"/>),
275   followed by header fields containing
276   request modifiers, client information, and representation metadata
277   (<xref target="header.fields"/>),
278   an empty line to indicate the end of the header section, and finally
279   a message body containing the payload body (if any,
280   <xref target="message.body"/>).
283   A server responds to a client's request by sending one or more HTTP
284   response
285   messages, each beginning with a status line that
286   includes the protocol version, a success or error code, and textual
287   reason phrase (<xref target="status.line"/>),
288   possibly followed by header fields containing server
289   information, resource metadata, and representation metadata
290   (<xref target="header.fields"/>),
291   an empty line to indicate the end of the header section, and finally
292   a message body containing the payload body (if any,
293   <xref target="message.body"/>).
296   A connection might be used for multiple request/response exchanges,
297   as defined in <xref target="persistent.connections"/>.
300   The following example illustrates a typical message exchange for a
301   GET request (Section 4.3.1 of <xref target="RFC7231"/>) on the URI "":
304Client request:
305</preamble><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
306  GET /hello.txt HTTP/1.1
307  User-Agent: curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
308  Host:
309  Accept-Language: en, mi
311  ]]></artwork></figure>
313Server response:
314</preamble><artwork type="message/http; msgtype=&#34;response&#34;"><![CDATA[
315  HTTP/1.1 200 OK
316  Date: Mon, 27 Jul 2009 12:28:53 GMT
317  Server: Apache
318  Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
319  ETag: "34aa387-d-1568eb00"
320  Accept-Ranges: bytes
321  Content-Length: 51
322  Vary: Accept-Encoding
323  Content-Type: text/plain
325  Hello World! My payload includes a trailing CRLF.
326  ]]></artwork>
330<section title="Implementation Diversity" anchor="implementation-diversity">
332   When considering the design of HTTP, it is easy to fall into a trap of
333   thinking that all user agents are general-purpose browsers and all origin
334   servers are large public websites. That is not the case in practice.
335   Common HTTP user agents include household appliances, stereos, scales,
336   firmware update scripts, command-line programs, mobile apps,
337   and communication devices in a multitude of shapes and sizes.  Likewise,
338   common HTTP origin servers include home automation units, configurable
339   networking components, office machines, autonomous robots, news feeds,
340   traffic cameras, ad selectors, and video-delivery platforms.
343   The term "user agent" does not imply that there is a human user directly
344   interacting with the software agent at the time of a request. In many
345   cases, a user agent is installed or configured to run in the background
346   and save its results for later inspection (or save only a subset of those
347   results that might be interesting or erroneous). Spiders, for example, are
348   typically given a start URI and configured to follow certain behavior while
349   crawling the Web as a hypertext graph.
352   The implementation diversity of HTTP means that not all user agents can
353   make interactive suggestions to their user or provide adequate warning for
354   security or privacy concerns. In the few cases where this
355   specification requires reporting of errors to the user, it is acceptable
356   for such reporting to only be observable in an error console or log file.
357   Likewise, requirements that an automated action be confirmed by the user
358   before proceeding might be met via advance configuration choices,
359   run-time options, or simple avoidance of the unsafe action; confirmation
360   does not imply any specific user interface or interruption of normal
361   processing if the user has already made that choice.
365<section title="Intermediaries" anchor="intermediaries">
366<iref primary="true" item="intermediary"/>
368   HTTP enables the use of intermediaries to satisfy requests through
369   a chain of connections.  There are three common forms of HTTP
370   intermediary: proxy, gateway, and tunnel.  In some cases,
371   a single intermediary might act as an origin server, proxy, gateway,
372   or tunnel, switching behavior based on the nature of each request.
374<figure><artwork type="drawing"><![CDATA[
375         >             >             >             >
376    UA =========== A =========== B =========== C =========== O
377               <             <             <             <
380   The figure above shows three intermediaries (A, B, and C) between the
381   user agent and origin server. A request or response message that
382   travels the whole chain will pass through four separate connections.
383   Some HTTP communication options
384   might apply only to the connection with the nearest, non-tunnel
385   neighbor, only to the endpoints of the chain, or to all connections
386   along the chain. Although the diagram is linear, each participant might
387   be engaged in multiple, simultaneous communications. For example, B
388   might be receiving requests from many clients other than A, and/or
389   forwarding requests to servers other than C, at the same time that it
390   is handling A's request. Likewise, later requests might be sent through a
391   different path of connections, often based on dynamic configuration for
392   load balancing.   
395<iref primary="true" item="upstream"/><iref primary="true" item="downstream"/>
396<iref primary="true" item="inbound"/><iref primary="true" item="outbound"/>
397   The terms "upstream" and "downstream" are
398   used to describe directional requirements in relation to the message flow:
399   all messages flow from upstream to downstream.
400   The terms "inbound" and "outbound" are used to describe directional
401   requirements in relation to the request route:
402   "inbound" means toward the origin server and
403   "outbound" means toward the user agent.
405<t><iref primary="true" item="proxy"/>
406   A "proxy" is a message-forwarding agent that is selected by the
407   client, usually via local configuration rules, to receive requests
408   for some type(s) of absolute URI and attempt to satisfy those
409   requests via translation through the HTTP interface.  Some translations
410   are minimal, such as for proxy requests for "http" URIs, whereas
411   other requests might require translation to and from entirely different
412   application-level protocols. Proxies are often used to group an
413   organization's HTTP requests through a common intermediary for the
414   sake of security, annotation services, or shared caching. Some proxies
415   are designed to apply transformations to selected messages or payloads
416   while they are being forwarded, as described in
417   <xref target="message.transformations"/>.
419<t><iref primary="true" item="gateway"/><iref primary="true" item="reverse proxy"/>
420<iref primary="true" item="accelerator"/>
421   A "gateway" (a.k.a. "reverse proxy") is an
422   intermediary that acts as an origin server for the outbound connection but
423   translates received requests and forwards them inbound to another server or
424   servers. Gateways are often used to encapsulate legacy or untrusted
425   information services, to improve server performance through
426   "accelerator" caching, and to enable partitioning or load
427   balancing of HTTP services across multiple machines.
430   All HTTP requirements applicable to an origin server
431   also apply to the outbound communication of a gateway.
432   A gateway communicates with inbound servers using any protocol that
433   it desires, including private extensions to HTTP that are outside
434   the scope of this specification.  However, an HTTP-to-HTTP gateway
435   that wishes to interoperate with third-party HTTP servers ought to conform
436   to user agent requirements on the gateway's inbound connection.
438<t><iref primary="true" item="tunnel"/>
439   A "tunnel" acts as a blind relay between two connections
440   without changing the messages. Once active, a tunnel is not
441   considered a party to the HTTP communication, though the tunnel might
442   have been initiated by an HTTP request. A tunnel ceases to exist when
443   both ends of the relayed connection are closed. Tunnels are used to
444   extend a virtual connection through an intermediary, such as when
445   Transport Layer Security (TLS, <xref target="RFC5246"/>) is used to
446   establish confidential communication through a shared firewall proxy.
449   The above categories for intermediary only consider those acting as
450   participants in the HTTP communication.  There are also intermediaries
451   that can act on lower layers of the network protocol stack, filtering or
452   redirecting HTTP traffic without the knowledge or permission of message
453   senders. Network intermediaries are indistinguishable (at a protocol level)
454   from a man-in-the-middle attack, often introducing security flaws or
455   interoperability problems due to mistakenly violating HTTP semantics.
457<t><iref primary="true" item="interception proxy"/>
458<iref primary="true" item="transparent proxy"/>
459<iref primary="true" item="captive portal"/>
460   For example, an
461   "interception proxy" <xref target="RFC3040"/> (also commonly
462   known as a "transparent proxy" <xref target="RFC1919"/> or
463   "captive portal")
464   differs from an HTTP proxy because it is not selected by the client.
465   Instead, an interception proxy filters or redirects outgoing TCP port 80
466   packets (and occasionally other common port traffic).
467   Interception proxies are commonly found on public network access points,
468   as a means of enforcing account subscription prior to allowing use of
469   non-local Internet services, and within corporate firewalls to enforce
470   network usage policies.
473   HTTP is defined as a stateless protocol, meaning that each request message
474   can be understood in isolation.  Many implementations depend on HTTP's
475   stateless design in order to reuse proxied connections or dynamically
476   load balance requests across multiple servers.  Hence, a server MUST NOT
477   assume that two requests on the same connection are from the same user
478   agent unless the connection is secured and specific to that agent.
479   Some non-standard HTTP extensions (e.g., <xref target="RFC4559"/>) have
480   been known to violate this requirement, resulting in security and
481   interoperability problems.
485<section title="Caches" anchor="caches">
486<iref primary="true" item="cache"/>
488   A "cache" is a local store of previous response messages and the
489   subsystem that controls its message storage, retrieval, and deletion.
490   A cache stores cacheable responses in order to reduce the response
491   time and network bandwidth consumption on future, equivalent
492   requests. Any client or server MAY employ a cache, though a cache
493   cannot be used by a server while it is acting as a tunnel.
496   The effect of a cache is that the request/response chain is shortened
497   if one of the participants along the chain has a cached response
498   applicable to that request. The following illustrates the resulting
499   chain if B has a cached copy of an earlier response from O (via C)
500   for a request that has not been cached by UA or A.
502<figure><artwork type="drawing"><![CDATA[
503            >             >
504       UA =========== A =========== B - - - - - - C - - - - - - O
505                  <             <
507<t><iref primary="true" item="cacheable"/>
508   A response is "cacheable" if a cache is allowed to store a copy of
509   the response message for use in answering subsequent requests.
510   Even when a response is cacheable, there might be additional
511   constraints placed by the client or by the origin server on when
512   that cached response can be used for a particular request. HTTP
513   requirements for cache behavior and cacheable responses are
514   defined in Section 2 of <xref target="RFC7234"/>. 
517   There is a wide variety of architectures and configurations
518   of caches deployed across the World Wide Web and
519   inside large organizations. These include national hierarchies
520   of proxy caches to save transoceanic bandwidth, collaborative systems that
521   broadcast or multicast cache entries, archives of pre-fetched cache
522   entries for use in off-line or high-latency environments, and so on.
526<section title="Conformance and Error Handling" anchor="conformance">
528   This specification targets conformance criteria according to the role of
529   a participant in HTTP communication.  Hence, HTTP requirements are placed
530   on senders, recipients, clients, servers, user agents, intermediaries,
531   origin servers, proxies, gateways, or caches, depending on what behavior
532   is being constrained by the requirement. Additional (social) requirements
533   are placed on implementations, resource owners, and protocol element
534   registrations when they apply beyond the scope of a single communication.
537   The verb "generate" is used instead of "send" where a requirement
538   differentiates between creating a protocol element and merely forwarding a
539   received element downstream.
542   An implementation is considered conformant if it complies with all of the
543   requirements associated with the roles it partakes in HTTP.
546   Conformance includes both the syntax and semantics of protocol
547   elements. A sender MUST NOT generate protocol elements that convey a
548   meaning that is known by that sender to be false. A sender MUST NOT
549   generate protocol elements that do not match the grammar defined by the
550   corresponding ABNF rules. Within a given message, a sender MUST NOT
551   generate protocol elements or syntax alternatives that are only allowed to
552   be generated by participants in other roles (i.e., a role that the sender
553   does not have for that message).
556   When a received protocol element is parsed, the recipient MUST be able to
557   parse any value of reasonable length that is applicable to the recipient's
558   role and that matches the grammar defined by the corresponding ABNF rules.
559   Note, however, that some received protocol elements might not be parsed.
560   For example, an intermediary forwarding a message might parse a
561   header-field into generic field-name and field-value components, but then
562   forward the header field without further parsing inside the field-value.
565   HTTP does not have specific length limitations for many of its protocol
566   elements because the lengths that might be appropriate will vary widely,
567   depending on the deployment context and purpose of the implementation.
568   Hence, interoperability between senders and recipients depends on shared
569   expectations regarding what is a reasonable length for each protocol
570   element. Furthermore, what is commonly understood to be a reasonable length
571   for some protocol elements has changed over the course of the past two
572   decades of HTTP use and is expected to continue changing in the future.
575   At a minimum, a recipient MUST be able to parse and process protocol
576   element lengths that are at least as long as the values that it generates
577   for those same protocol elements in other messages. For example, an origin
578   server that publishes very long URI references to its own resources needs
579   to be able to parse and process those same references when received as a
580   request target.
583   A recipient MUST interpret a received protocol element according to the
584   semantics defined for it by this specification, including extensions to
585   this specification, unless the recipient has determined (through experience
586   or configuration) that the sender incorrectly implements what is implied by
587   those semantics.
588   For example, an origin server might disregard the contents of a received
589   Accept-Encoding header field if inspection of the
590   User-Agent header field indicates a specific implementation
591   version that is known to fail on receipt of certain content codings.
594   Unless noted otherwise, a recipient MAY attempt to recover a usable
595   protocol element from an invalid construct.  HTTP does not define
596   specific error handling mechanisms except when they have a direct impact
597   on security, since different applications of the protocol require
598   different error handling strategies.  For example, a Web browser might
599   wish to transparently recover from a response where the
600   Location header field doesn't parse according to the ABNF,
601   whereas a systems control client might consider any form of error recovery
602   to be dangerous.
606<section title="Protocol Versioning" anchor="http.version">
610   HTTP uses a "&lt;major&gt;.&lt;minor&gt;" numbering scheme to indicate
611   versions of the protocol. This specification defines version "1.1".
612   The protocol version as a whole indicates the sender's conformance
613   with the set of requirements laid out in that version's corresponding
614   specification of HTTP.
617   The version of an HTTP message is indicated by an HTTP-version field
618   in the first line of the message. HTTP-version is case-sensitive.
620<figure><iref primary="true" item="Grammar" subitem="HTTP-version"/><iref primary="true" item="Grammar" subitem="HTTP-name"/><artwork type="abnf2616"><![CDATA[
621  HTTP-version  = HTTP-name "/" DIGIT "." DIGIT
622  HTTP-name     = %x48.54.54.50 ; "HTTP", case-sensitive
625   The HTTP version number consists of two decimal digits separated by a "."
626   (period or decimal point).  The first digit ("major version") indicates the
627   HTTP messaging syntax, whereas the second digit ("minor version") indicates
628   the highest minor version within that major version to which the sender is
629   conformant and able to understand for future communication.  The minor
630   version advertises the sender's communication capabilities even when the
631   sender is only using a backwards-compatible subset of the protocol,
632   thereby letting the recipient know that more advanced features can
633   be used in response (by servers) or in future requests (by clients).
636   When an HTTP/1.1 message is sent to an HTTP/1.0 recipient
637   <xref target="RFC1945"/> or a recipient whose version is unknown,
638   the HTTP/1.1 message is constructed such that it can be interpreted
639   as a valid HTTP/1.0 message if all of the newer features are ignored.
640   This specification places recipient-version requirements on some
641   new features so that a conformant sender will only use compatible
642   features until it has determined, through configuration or the
643   receipt of a message, that the recipient supports HTTP/1.1.
646   The interpretation of a header field does not change between minor
647   versions of the same major HTTP version, though the default
648   behavior of a recipient in the absence of such a field can change.
649   Unless specified otherwise, header fields defined in HTTP/1.1 are
650   defined for all versions of HTTP/1.x.  In particular, the <xref target="" format="none">Host</xref>
651   and <xref target="header.connection" format="none">Connection</xref> header fields ought to be implemented by all
652   HTTP/1.x implementations whether or not they advertise conformance with
653   HTTP/1.1.
656   New header fields can be introduced without changing the protocol version
657   if their defined semantics allow them to be safely ignored by recipients
658   that do not recognize them. Header field extensibility is discussed in
659   <xref target="field.extensibility"/>.
662   Intermediaries that process HTTP messages (i.e., all intermediaries
663   other than those acting as tunnels) MUST send their own HTTP-version
664   in forwarded messages.  In other words, they are not allowed to blindly
665   forward the first line of an HTTP message without ensuring that the
666   protocol version in that message matches a version to which that
667   intermediary is conformant for both the receiving and
668   sending of messages.  Forwarding an HTTP message without rewriting
669   the HTTP-version might result in communication errors when downstream
670   recipients use the message sender's version to determine what features
671   are safe to use for later communication with that sender.
674   A client SHOULD send a request version equal to the highest
675   version to which the client is conformant and
676   whose major version is no higher than the highest version supported
677   by the server, if this is known.  A client MUST NOT send a
678   version to which it is not conformant.
681   A client MAY send a lower request version if it is known that
682   the server incorrectly implements the HTTP specification, but only
683   after the client has attempted at least one normal request and determined
684   from the response status code or header fields (e.g., Server) that
685   the server improperly handles higher request versions.
688   A server SHOULD send a response version equal to the highest version to
689   which the server is conformant that has a major version less than or equal
690   to the one received in the request.
691   A server MUST NOT send a version to which it is not conformant.
692   A server can send a 505 (HTTP Version Not Supported)
693   response if it wishes, for any reason, to refuse service of the client's
694   major protocol version.
697   A server MAY send an HTTP/1.0 response to a request
698   if it is known or suspected that the client incorrectly implements the
699   HTTP specification and is incapable of correctly processing later
700   version responses, such as when a client fails to parse the version
701   number correctly or when an intermediary is known to blindly forward
702   the HTTP-version even when it doesn't conform to the given minor
703   version of the protocol. Such protocol downgrades SHOULD NOT be
704   performed unless triggered by specific client attributes, such as when
705   one or more of the request header fields (e.g., User-Agent)
706   uniquely match the values sent by a client known to be in error.
709   The intention of HTTP's versioning design is that the major number
710   will only be incremented if an incompatible message syntax is
711   introduced, and that the minor number will only be incremented when
712   changes made to the protocol have the effect of adding to the message
713   semantics or implying additional capabilities of the sender.  However,
714   the minor version was not incremented for the changes introduced between
715   <xref target="RFC2068"/> and <xref target="RFC2616"/>, and this revision
716   has specifically avoided any such changes to the protocol.
719   When an HTTP message is received with a major version number that the
720   recipient implements, but a higher minor version number than what the
721   recipient implements, the recipient SHOULD process the message as if it
722   were in the highest minor version within that major version to which the
723   recipient is conformant. A recipient can assume that a message with a
724   higher minor version, when sent to a recipient that has not yet indicated
725   support for that higher version, is sufficiently backwards-compatible to be
726   safely processed by any implementation of the same major version.
730<section title="Uniform Resource Identifiers" anchor="uri">
731<iref primary="true" item="resource"/>
733   Uniform Resource Identifiers (URIs) <xref target="RFC3986"/> are used
734   throughout HTTP as the means for identifying resources (Section 2 of <xref target="RFC7231"/>).
735   URI references are used to target requests, indicate redirects, and define
736   relationships.
753   The definitions of "URI-reference",
754   "absolute-URI", "relative-part", "scheme", "authority", "port", "host",
755   "path-abempty", "segment", "query", and "fragment" are adopted from the
756   URI generic syntax.
757   An "absolute-path" rule is defined for protocol elements that can contain a
758   non-empty path component. (This rule differs slightly from the path-abempty
759   rule of RFC 3986, which allows for an empty path to be used in references,
760   and path-absolute rule, which does not allow paths that begin with "//".)
761   A "partial-URI" rule is defined for protocol elements
762   that can contain a relative URI but not a fragment component.
764<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[
765  URI-reference = <URI-reference, see [RFC3986], Section 4.1>
766  absolute-URI  = <absolute-URI, see [RFC3986], Section 4.3>
767  relative-part = <relative-part, see [RFC3986], Section 4.2>
768  scheme        = <scheme, see [RFC3986], Section 3.1>
769  authority     = <authority, see [RFC3986], Section 3.2>
770  uri-host      = <host, see [RFC3986], Section 3.2.2>
771  port          = <port, see [RFC3986], Section 3.2.3>
772  path-abempty  = <path-abempty, see [RFC3986], Section 3.3>
773  segment       = <segment, see [RFC3986], Section 3.3>
774  query         = <query, see [RFC3986], Section 3.4>
775  fragment      = <fragment, see [RFC3986], Section 3.5>
777  absolute-path = 1*( "/" segment )
778  partial-URI   = relative-part [ "?" query ]
781   Each protocol element in HTTP that allows a URI reference will indicate
782   in its ABNF production whether the element allows any form of reference
783   (URI-reference), only a URI in absolute form (absolute-URI), only the
784   path and optional query components, or some combination of the above.
785   Unless otherwise indicated, URI references are parsed
786   relative to the effective request URI
787   (<xref target="effective.request.uri"/>).
790<section title="http URI Scheme" anchor="http.uri">
792  <iref item="http URI scheme" primary="true"/>
793  <iref item="URI scheme" subitem="http" primary="true"/>
795   The "http" URI scheme is hereby defined for the purpose of minting
796   identifiers according to their association with the hierarchical
797   namespace governed by a potential HTTP origin server listening for
798   TCP (<xref target="RFC0793"/>) connections on a given port.
800<figure><iref primary="true" item="Grammar" subitem="http-URI"><!--terminal production--></iref><artwork type="abnf2616"><![CDATA[
801  http-URI = "http:" "//" authority path-abempty [ "?" query ]
802             [ "#" fragment ]
805   The origin server for an "http" URI is identified by the
806   <xref target="uri" format="none">authority</xref> component, which includes a host identifier
807   and optional TCP port (<xref target="RFC3986"/>, Section 3.2.2).
808   The hierarchical path component and optional query component serve as an
809   identifier for a potential target resource within that origin server's name
810   space. The optional fragment component allows for indirect identification
811   of a secondary resource, independent of the URI scheme, as defined in
812   Section 3.5 of <xref target="RFC3986"/>.
815   A sender MUST NOT generate an "http" URI with an empty host identifier.
816   A recipient that processes such a URI reference MUST reject it as invalid.
819   If the host identifier is provided as an IP address, the origin server is
820   the listener (if any) on the indicated TCP port at that IP address.
821   If host is a registered name, the registered name is an indirect identifier
822   for use with a name resolution service, such as DNS, to find an address for
823   that origin server.
824   If the port subcomponent is empty or not given, TCP port 80 (the
825   reserved port for WWW services) is the default.
828   Note that the presence of a URI with a given authority component does not
829   imply that there is always an HTTP server listening for connections on
830   that host and port. Anyone can mint a URI. What the authority component
831   determines is who has the right to respond authoritatively to requests that
832   target the identified resource. The delegated nature of registered names
833   and IP addresses creates a federated namespace, based on control over the
834   indicated host and port, whether or not an HTTP server is present.
835   See <xref target="establishing.authority"/> for security considerations
836   related to establishing authority.
839   When an "http" URI is used within a context that calls for access to the
840   indicated resource, a client MAY attempt access by resolving
841   the host to an IP address, establishing a TCP connection to that address
842   on the indicated port, and sending an HTTP request message
843   (<xref target="http.message"/>) containing the URI's identifying data
844   (<xref target="message.routing"/>) to the server.
845   If the server responds to that request with a non-interim HTTP response
846   message, as described in Section 6 of <xref target="RFC7231"/>, then that response
847   is considered an authoritative answer to the client's request.
850   Although HTTP is independent of the transport protocol, the "http"
851   scheme is specific to TCP-based services because the name delegation
852   process depends on TCP for establishing authority.
853   An HTTP service based on some other underlying connection protocol
854   would presumably be identified using a different URI scheme, just as
855   the "https" scheme (below) is used for resources that require an
856   end-to-end secured connection. Other protocols might also be used to
857   provide access to "http" identified resources -- it is only the
858   authoritative interface that is specific to TCP.
861   The URI generic syntax for authority also includes a deprecated
862   userinfo subcomponent (<xref target="RFC3986"/>, Section 3.2.1)
863   for including user authentication information in the URI.  Some
864   implementations make use of the userinfo component for internal
865   configuration of authentication information, such as within command
866   invocation options, configuration files, or bookmark lists, even
867   though such usage might expose a user identifier or password.
868   A sender MUST NOT generate the userinfo subcomponent (and its "@"
869   delimiter) when an "http" URI reference is generated within a message as a
870   request target or header field value.
871   Before making use of an "http" URI reference received from an untrusted
872   source, a recipient SHOULD parse for userinfo and treat its presence as
873   an error; it is likely being used to obscure the authority for the sake of
874   phishing attacks.
878<section title="https URI Scheme" anchor="https.uri">
880   <iref item="https URI scheme"/>
881   <iref item="URI scheme" subitem="https"/>
883   The "https" URI scheme is hereby defined for the purpose of minting
884   identifiers according to their association with the hierarchical
885   namespace governed by a potential HTTP origin server listening to a
886   given TCP port for TLS-secured connections (<xref target="RFC5246"/>).
889   All of the requirements listed above for the "http" scheme are also
890   requirements for the "https" scheme, except that TCP port 443 is the
891   default if the port subcomponent is empty or not given,
892   and the user agent MUST ensure that its connection to the origin
893   server is secured through the use of strong encryption, end-to-end,
894   prior to sending the first HTTP request.
896<figure><iref primary="true" item="Grammar" subitem="https-URI"><!--terminal production--></iref><artwork type="abnf2616"><![CDATA[
897  https-URI = "https:" "//" authority path-abempty [ "?" query ]
898              [ "#" fragment ]
901   Note that the "https" URI scheme depends on both TLS and TCP for
902   establishing authority.
903   Resources made available via the "https" scheme have no shared
904   identity with the "http" scheme even if their resource identifiers
905   indicate the same authority (the same host listening to the same
906   TCP port).  They are distinct namespaces and are considered to be
907   distinct origin servers.  However, an extension to HTTP that is
908   defined to apply to entire host domains, such as the Cookie protocol
909   <xref target="RFC6265"/>, can allow information
910   set by one service to impact communication with other services
911   within a matching group of host domains.
914   The process for authoritative access to an "https" identified
915   resource is defined in <xref target="RFC2818"/>.
919<section title="http and https URI Normalization and Comparison" anchor="uri.comparison">
921   Since the "http" and "https" schemes conform to the URI generic syntax,
922   such URIs are normalized and compared according to the algorithm defined
923   in Section 6 of <xref target="RFC3986"/>, using the defaults
924   described above for each scheme.
927   If the port is equal to the default port for a scheme, the normal form is
928   to omit the port subcomponent. When not being used in absolute form as the
929   request target of an OPTIONS request, an empty path component is equivalent
930   to an absolute path of "/", so the normal form is to provide a path of "/"
931   instead. The scheme and host are case-insensitive and normally provided in
932   lowercase; all other components are compared in a case-sensitive manner.
933   Characters other than those in the "reserved" set are equivalent to their
934   percent-encoded octets: the normal form is to not encode them
935   (see Sections 2.1 and
936   2.2 of
937   <xref target="RFC3986"/>).
940   For example, the following three URIs are equivalent:
942<figure><artwork type="example"><![CDATA[
951<section title="Message Format" anchor="http.message">
956<iref item="header section"/>
957<iref item="headers"/>
958<iref item="header field"/>
960   All HTTP/1.1 messages consist of a start-line followed by a sequence of
961   octets in a format similar to the Internet Message Format
962   <xref target="RFC5322"/>: zero or more header fields (collectively
963   referred to as the "headers" or the "header section"), an empty line
964   indicating the end of the header section, and an optional message body.
966<figure><iref primary="true" item="Grammar" subitem="HTTP-message"><!--terminal production--></iref><artwork type="abnf2616"><![CDATA[
967  HTTP-message   = start-line
968                   *( header-field CRLF )
969                   CRLF
970                   [ message-body ]
973   The normal procedure for parsing an HTTP message is to read the
974   start-line into a structure, read each header field into a hash
975   table by field name until the empty line, and then use the parsed
976   data to determine if a message body is expected.  If a message body
977   has been indicated, then it is read as a stream until an amount
978   of octets equal to the message body length is read or the connection
979   is closed.
982   A recipient MUST parse an HTTP message as a sequence of octets in an
983   encoding that is a superset of US-ASCII <xref target="USASCII"/>.
984   Parsing an HTTP message as a stream of Unicode characters, without regard
985   for the specific encoding, creates security vulnerabilities due to the
986   varying ways that string processing libraries handle invalid multibyte
987   character sequences that contain the octet LF (%x0A).  String-based
988   parsers can only be safely used within protocol elements after the element
989   has been extracted from the message, such as within a header field-value
990   after message parsing has delineated the individual fields.
993   An HTTP message can be parsed as a stream for incremental processing or
994   forwarding downstream.  However, recipients cannot rely on incremental
995   delivery of partial messages, since some implementations will buffer or
996   delay message forwarding for the sake of network efficiency, security
997   checks, or payload transformations.
1000   A sender MUST NOT send whitespace between the start-line and
1001   the first header field.
1002   A recipient that receives whitespace between the start-line and
1003   the first header field MUST either reject the message as invalid or
1004   consume each whitespace-preceded line without further processing of it
1005   (i.e., ignore the entire line, along with any subsequent lines preceded
1006   by whitespace, until a properly formed header field is received or the
1007   header section is terminated).
1010   The presence of such whitespace in a request
1011   might be an attempt to trick a server into ignoring that field or
1012   processing the line after it as a new request, either of which might
1013   result in a security vulnerability if other implementations within
1014   the request chain interpret the same message differently.
1015   Likewise, the presence of such whitespace in a response might be
1016   ignored by some clients or cause others to cease parsing.
1019<section title="Start Line" anchor="start.line">
1022   An HTTP message can be either a request from client to server or a
1023   response from server to client.  Syntactically, the two types of message
1024   differ only in the start-line, which is either a request-line (for requests)
1025   or a status-line (for responses), and in the algorithm for determining
1026   the length of the message body (<xref target="message.body"/>).
1029   In theory, a client could receive requests and a server could receive
1030   responses, distinguishing them by their different start-line formats,
1031   but, in practice, servers are implemented to only expect a request
1032   (a response is interpreted as an unknown or invalid request method)
1033   and clients are implemented to only expect a response.
1035<figure><iref primary="true" item="Grammar" subitem="start-line"/><artwork type="abnf2616"><![CDATA[
1036  start-line     = request-line / status-line
1039<section title="Request Line" anchor="request.line">
1043   A request-line begins with a method token, followed by a single
1044   space (SP), the request-target, another single space (SP), the
1045   protocol version, and ends with CRLF.
1047<figure><iref primary="true" item="Grammar" subitem="request-line"/><artwork type="abnf2616"><![CDATA[
1048  request-line   = method SP request-target SP HTTP-version CRLF
1050<iref primary="true" item="method"/>
1051<t anchor="method">
1052   The method token indicates the request method to be performed on the
1053   target resource. The request method is case-sensitive.
1055<figure><iref primary="true" item="Grammar" subitem="method"/><artwork type="abnf2616"><![CDATA[
1056  method         = token
1059   The request methods defined by this specification can be found in
1060   Section 4 of <xref target="RFC7231"/>, along with information regarding the HTTP method registry
1061   and considerations for defining new methods.
1063<iref item="request-target"/>
1065   The request-target identifies the target resource upon which to apply
1066   the request, as defined in <xref target="request-target"/>.
1069   Recipients typically parse the request-line into its component parts by
1070   splitting on whitespace (see <xref target="message.robustness"/>), since
1071   no whitespace is allowed in the three components.
1072   Unfortunately, some user agents fail to properly encode or exclude
1073   whitespace found in hypertext references, resulting in those disallowed
1074   characters being sent in a request-target.
1077   Recipients of an invalid request-line SHOULD respond with either a
1078   400 (Bad Request) error or a 301 (Moved Permanently)
1079   redirect with the request-target properly encoded.  A recipient SHOULD NOT
1080   attempt to autocorrect and then process the request without a redirect,
1081   since the invalid request-line might be deliberately crafted to bypass
1082   security filters along the request chain.
1085   HTTP does not place a predefined limit on the length of a request-line,
1086   as described in <xref target="conformance"/>.
1087   A server that receives a method longer than any that it implements
1088   SHOULD respond with a 501 (Not Implemented) status code.
1089   A server that receives a request-target longer than any URI it wishes to
1090   parse MUST respond with a
1091   414 (URI Too Long) status code (see Section 6.5.12 of <xref target="RFC7231"/>).
1094   Various ad hoc limitations on request-line length are found in practice.
1095   It is RECOMMENDED that all HTTP senders and recipients support, at a
1096   minimum, request-line lengths of 8000 octets.
1100<section title="Status Line" anchor="status.line">
1106   The first line of a response message is the status-line, consisting
1107   of the protocol version, a space (SP), the status code, another space,
1108   a possibly empty textual phrase describing the status code, and
1109   ending with CRLF.
1111<figure><iref primary="true" item="Grammar" subitem="status-line"/><artwork type="abnf2616"><![CDATA[
1112  status-line = HTTP-version SP status-code SP reason-phrase CRLF
1115   The status-code element is a 3-digit integer code describing the
1116   result of the server's attempt to understand and satisfy the client's
1117   corresponding request. The rest of the response message is to be
1118   interpreted in light of the semantics defined for that status code.
1119   See Section 6 of <xref target="RFC7231"/> for information about the semantics of status codes,
1120   including the classes of status code (indicated by the first digit),
1121   the status codes defined by this specification, considerations for the
1122   definition of new status codes, and the IANA registry.
1124<figure><iref primary="true" item="Grammar" subitem="status-code"/><artwork type="abnf2616"><![CDATA[
1125  status-code    = 3DIGIT
1128   The reason-phrase element exists for the sole purpose of providing a
1129   textual description associated with the numeric status code, mostly
1130   out of deference to earlier Internet application protocols that were more
1131   frequently used with interactive text clients. A client SHOULD ignore
1132   the reason-phrase content.
1134<figure><iref primary="true" item="Grammar" subitem="reason-phrase"/><artwork type="abnf2616"><![CDATA[
1135  reason-phrase  = *( HTAB / SP / VCHAR / obs-text )
1140<section title="Header Fields" anchor="header.fields">
1148   Each header field consists of a case-insensitive field name
1149   followed by a colon (":"), optional leading whitespace, the field value,
1150   and optional trailing whitespace.
1152<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[
1153  header-field   = field-name ":" OWS field-value OWS
1155  field-name     = token
1156  field-value    = *( field-content / obs-fold )
1157  field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]
1158  field-vchar    = VCHAR / obs-text
1160  obs-fold       = CRLF 1*( SP / HTAB )
1161                 ; obsolete line folding
1162                 ; see Section 3.2.4
1165   The field-name token labels the corresponding field-value as having the
1166   semantics defined by that header field.  For example, the Date
1167   header field is defined in Section of <xref target="RFC7231"/> as containing the origination
1168   timestamp for the message in which it appears.
1171<section title="Field Extensibility" anchor="field.extensibility">
1173   Header fields are fully extensible: there is no limit on the
1174   introduction of new field names, each presumably defining new semantics,
1175   nor on the number of header fields used in a given message.  Existing
1176   fields are defined in each part of this specification and in many other
1177   specifications outside this document set.
1180   New header fields can be defined such that, when they are understood by a
1181   recipient, they might override or enhance the interpretation of previously
1182   defined header fields, define preconditions on request evaluation, or
1183   refine the meaning of responses.
1186   A proxy MUST forward unrecognized header fields unless the
1187   field-name is listed in the <xref target="header.connection" format="none">Connection</xref> header field
1188   (<xref target="header.connection"/>) or the proxy is specifically
1189   configured to block, or otherwise transform, such fields.
1190   Other recipients SHOULD ignore unrecognized header fields.
1191   These requirements allow HTTP's functionality to be enhanced without
1192   requiring prior update of deployed intermediaries.
1195   All defined header fields ought to be registered with IANA in the
1196   "Message Headers" registry, as described in Section 8.3 of <xref target="RFC7231"/>.
1200<section title="Field Order" anchor="field.order">
1202   The order in which header fields with differing field names are
1203   received is not significant. However, it is good practice to send
1204   header fields that contain control data first, such as <xref target="" format="none">Host</xref>
1205   on requests and Date on responses, so that implementations
1206   can decide when not to handle a message as early as possible.
1207   A server MUST NOT apply a request to the target resource until the entire
1208   request header section is received, since later header fields might include
1209   conditionals, authentication credentials, or deliberately misleading
1210   duplicate header fields that would impact request processing.
1213   A sender MUST NOT generate multiple header fields with the same field
1214   name in a message unless either the entire field value for that
1215   header field is defined as a comma-separated list [i.e., #(values)]
1216   or the header field is a well-known exception (as noted below).
1219   A recipient MAY combine multiple header fields with the same field name
1220   into one "field-name: field-value" pair, without changing the semantics of
1221   the message, by appending each subsequent field value to the combined
1222   field value in order, separated by a comma. The order in which
1223   header fields with the same field name are received is therefore
1224   significant to the interpretation of the combined field value;
1225   a proxy MUST NOT change the order of these field values when
1226   forwarding a message.
1229  <t>
1230   Note: In practice, the "Set-Cookie" header field (<xref target="RFC6265"/>)
1231   often appears multiple times in a response message and does not use the
1232   list syntax, violating the above requirements on multiple header fields
1233   with the same name. Since it cannot be combined into a single field-value,
1234   recipients ought to handle "Set-Cookie" as a special case while processing
1235   header fields. (See Appendix A.2.3 of <xref target="Kri2001"/> for details.)
1236  </t>
1240<section title="Whitespace" anchor="whitespace">
1241<t anchor="rule.LWS">
1242   This specification uses three rules to denote the use of linear
1243   whitespace: OWS (optional whitespace), RWS (required whitespace), and
1244   BWS ("bad" whitespace).
1246<t anchor="rule.OWS">
1247   The OWS rule is used where zero or more linear whitespace octets might
1248   appear. For protocol elements where optional whitespace is preferred to
1249   improve readability, a sender SHOULD generate the optional whitespace
1250   as a single SP; otherwise, a sender SHOULD NOT generate optional
1251   whitespace except as needed to white out invalid or unwanted protocol
1252   elements during in-place message filtering.
1254<t anchor="rule.RWS">
1255   The RWS rule is used when at least one linear whitespace octet is required
1256   to separate field tokens. A sender SHOULD generate RWS as a single SP.
1258<t anchor="rule.BWS">
1259   The BWS rule is used where the grammar allows optional whitespace only for
1260   historical reasons. A sender MUST NOT generate BWS in messages.
1261   A recipient MUST parse for such bad whitespace and remove it before
1262   interpreting the protocol element.
1264<t anchor="rule.whitespace">
1269<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[
1270  OWS            = *( SP / HTAB )
1271                 ; optional whitespace
1272  RWS            = 1*( SP / HTAB )
1273                 ; required whitespace
1274  BWS            = OWS
1275                 ; "bad" whitespace
1279<section title="Field Parsing" anchor="field.parsing">
1281   Messages are parsed using a generic algorithm, independent of the
1282   individual header field names. The contents within a given field value are
1283   not parsed until a later stage of message interpretation (usually after the
1284   message's entire header section has been processed).
1285   Consequently, this specification does not use ABNF rules to define each
1286   "Field-Name: Field Value" pair, as was done in previous editions.
1287   Instead, this specification uses ABNF rules that are named according to
1288   each registered field name, wherein the rule defines the valid grammar for
1289   that field's corresponding field values (i.e., after the field-value
1290   has been extracted from the header section by a generic field parser).
1293   No whitespace is allowed between the header field-name and colon.
1294   In the past, differences in the handling of such whitespace have led to
1295   security vulnerabilities in request routing and response handling.
1296   A server MUST reject any received request message that contains
1297   whitespace between a header field-name and colon with a response code of
1298   400 (Bad Request). A proxy MUST remove any such whitespace
1299   from a response message before forwarding the message downstream.
1302   A field value might be preceded and/or followed by optional whitespace
1303   (OWS); a single SP preceding the field-value is preferred for consistent
1304   readability by humans.
1305   The field value does not include any leading or trailing whitespace: OWS
1306   occurring before the first non-whitespace octet of the field value or after
1307   the last non-whitespace octet of the field value ought to be excluded by
1308   parsers when extracting the field value from a header field.
1311   Historically, HTTP header field values could be extended over multiple
1312   lines by preceding each extra line with at least one space or horizontal
1313   tab (obs-fold). This specification deprecates such line folding except
1314   within the message/http media type
1315   (<xref target=""/>).
1316   A sender MUST NOT generate a message that includes line folding
1317   (i.e., that has any field-value that contains a match to the
1318   <xref target="header.fields" format="none">obs-fold</xref> rule) unless the message is intended for packaging
1319   within the message/http media type.
1322   A server that receives an <xref target="header.fields" format="none">obs-fold</xref> in a request message that
1323   is not within a message/http container MUST either reject the message by
1324   sending a 400 (Bad Request), preferably with a
1325   representation explaining that obsolete line folding is unacceptable, or
1326   replace each received <xref target="header.fields" format="none">obs-fold</xref> with one or more
1327   <xref target="core.rules" format="none">SP</xref> octets prior to interpreting the field value or
1328   forwarding the message downstream.
1331   A proxy or gateway that receives an <xref target="header.fields" format="none">obs-fold</xref> in a response
1332   message that is not within a message/http container MUST either discard
1333   the message and replace it with a 502 (Bad Gateway)
1334   response, preferably with a representation explaining that unacceptable
1335   line folding was received, or replace each received <xref target="header.fields" format="none">obs-fold</xref>
1336   with one or more <xref target="core.rules" format="none">SP</xref> octets prior to interpreting the field
1337   value or forwarding the message downstream.
1340   A user agent that receives an <xref target="header.fields" format="none">obs-fold</xref> in a response message
1341   that is not within a message/http container MUST replace each received
1342   <xref target="header.fields" format="none">obs-fold</xref> with one or more <xref target="core.rules" format="none">SP</xref> octets prior to
1343   interpreting the field value.
1346   Historically, HTTP has allowed field content with text in the ISO&nbhy;8859&nbhy;1 charset <xref target="ISO-8859-1"/>, supporting other charsets only
1347   through use of <xref target="RFC2047"/> encoding.
1348   In practice, most HTTP header field values use only a subset of the
1349   US-ASCII charset <xref target="USASCII"/>. Newly defined
1350   header fields SHOULD limit their field values to US&nbhy;ASCII octets.
1351   A recipient SHOULD treat other octets in field content (obs&nbhy;text) as
1352   opaque data.
1356<section title="Field Limits" anchor="field.limits">
1358   HTTP does not place a predefined limit on the length of each header field
1359   or on the length of the header section as a whole, as described in
1360   <xref target="conformance"/>. Various ad hoc limitations on individual
1361   header field length are found in practice, often depending on the specific
1362   field semantics.
1365   A server that receives a request header field, or set of fields, larger
1366   than it wishes to process MUST respond with an appropriate
1367   4xx (Client Error) status code. Ignoring such header fields
1368   would increase the server's vulnerability to request smuggling attacks
1369   (<xref target="request.smuggling"/>).
1372   A client MAY discard or truncate received header fields that are larger
1373   than the client wishes to process if the field semantics are such that the
1374   dropped value(s) can be safely ignored without changing the
1375   message framing or response semantics.
1379<section title="Field Value Components" anchor="field.components">
1380<t anchor="rule.token.separators">
1383  <iref item="Delimiters"/>
1384   Most HTTP header field values are defined using common syntax components
1385   (token, quoted-string, and comment) separated by whitespace or specific
1386   delimiting characters. Delimiters are chosen from the set of US-ASCII
1387   visual characters not allowed in a <xref target="rule.token.separators" format="none">token</xref>
1388   (DQUOTE and "(),/:;&lt;=&gt;?@[\]{}").
1390<figure><iref primary="true" item="Grammar" subitem="token"/><iref primary="true" item="Grammar" subitem="tchar"/><artwork type="abnf2616"><![CDATA[
1391  token          = 1*tchar
1393  tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
1394                 / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
1395                 / DIGIT / ALPHA
1396                 ; any VCHAR, except delimiters
1398<t anchor="rule.quoted-string">
1402   A string of text is parsed as a single value if it is quoted using
1403   double-quote marks.
1405<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[
1406  quoted-string  = DQUOTE *( qdtext / quoted-pair ) DQUOTE
1407  qdtext         = HTAB / SP /%x21 / %x23-5B / %x5D-7E / obs-text
1408  obs-text       = %x80-FF
1410<t anchor="rule.comment">
1413   Comments can be included in some HTTP header fields by surrounding
1414   the comment text with parentheses. Comments are only allowed in
1415   fields containing "comment" as part of their field value definition.
1417<figure><iref primary="true" item="Grammar" subitem="comment"/><iref primary="true" item="Grammar" subitem="ctext"/><artwork type="abnf2616"><![CDATA[
1418  comment        = "(" *( ctext / quoted-pair / comment ) ")"
1419  ctext          = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text
1421<t anchor="rule.quoted-pair">
1423   The backslash octet ("\") can be used as a single-octet
1424   quoting mechanism within quoted-string and comment constructs.
1425   Recipients that process the value of a quoted-string MUST handle a
1426   quoted-pair as if it were replaced by the octet following the backslash.
1428<figure><iref primary="true" item="Grammar" subitem="quoted-pair"/><artwork type="abnf2616"><![CDATA[
1429  quoted-pair    = "\" ( HTAB / SP / VCHAR / obs-text )
1432   A sender SHOULD NOT generate a quoted-pair in a quoted-string except
1433   where necessary to quote DQUOTE and backslash octets occurring within that
1434   string.
1435   A sender SHOULD NOT generate a quoted-pair in a comment except
1436   where necessary to quote parentheses ["(" and ")"] and backslash octets
1437   occurring within that comment.
1443<section title="Message Body" anchor="message.body">
1446   The message body (if any) of an HTTP message is used to carry the
1447   payload body of that request or response.  The message body is
1448   identical to the payload body unless a transfer coding has been
1449   applied, as described in <xref target="header.transfer-encoding"/>.
1451<figure><iref primary="true" item="Grammar" subitem="message-body"/><artwork type="abnf2616"><![CDATA[
1452  message-body = *OCTET
1455   The rules for when a message body is allowed in a message differ for
1456   requests and responses.
1459   The presence of a message body in a request is signaled by a
1460   <xref target="header.content-length" format="none">Content-Length</xref> or <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header
1461   field. Request message framing is independent of method semantics,
1462   even if the method does not define any use for a message body.
1465   The presence of a message body in a response depends on both
1466   the request method to which it is responding and the response
1467   status code (<xref target="status.line"/>).
1468   Responses to the HEAD request method (Section 4.3.2 of <xref target="RFC7231"/>) never include a message body
1469   because the associated response header fields (e.g.,
1470   <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref>, <xref target="header.content-length" format="none">Content-Length</xref>, etc.),
1471   if present, indicate only what their values would have been if the request
1472   method had been GET (Section 4.3.1 of <xref target="RFC7231"/>).
1473   2xx (Successful) responses to a CONNECT request method
1474   (Section 4.3.6 of <xref target="RFC7231"/>) switch to tunnel mode instead of having a message body.
1475   All 1xx (Informational), 204 (No Content), and
1476   304 (Not Modified) responses do not include a message body.
1477   All other responses do include a message body, although the body
1478   might be of zero length.
1481<section title="Transfer-Encoding" anchor="header.transfer-encoding">
1482  <iref primary="true" item="Transfer-Encoding header field"/>
1483  <iref item="chunked (Coding Format)"/>
1486   The Transfer-Encoding header field lists the transfer coding names
1487   corresponding to the sequence of transfer codings that have been
1488   (or will be) applied to the payload body in order to form the message body.
1489   Transfer codings are defined in <xref target="transfer.codings"/>.
1491<figure><iref primary="true" item="Grammar" subitem="Transfer-Encoding"/><artwork type="abnf2616"><![CDATA[
1492  Transfer-Encoding = 1#transfer-coding
1495   Transfer-Encoding is analogous to the Content-Transfer-Encoding field of
1496   MIME, which was designed to enable safe transport of binary data over a
1497   7-bit transport service (<xref target="RFC2045"/>, Section 6).
1498   However, safe transport has a different focus for an 8bit-clean transfer
1499   protocol. In HTTP's case, Transfer-Encoding is primarily intended to
1500   accurately delimit a dynamically generated payload and to distinguish
1501   payload encodings that are only applied for transport efficiency or
1502   security from those that are characteristics of the selected resource.
1505   A recipient MUST be able to parse the chunked transfer coding
1506   (<xref target="chunked.encoding"/>) because it plays a crucial role in
1507   framing messages when the payload body size is not known in advance.
1508   A sender MUST NOT apply chunked more than once to a message body
1509   (i.e., chunking an already chunked message is not allowed).
1510   If any transfer coding other than chunked is applied to a request payload
1511   body, the sender MUST apply chunked as the final transfer coding to
1512   ensure that the message is properly framed.
1513   If any transfer coding other than chunked is applied to a response payload
1514   body, the sender MUST either apply chunked as the final transfer coding
1515   or terminate the message by closing the connection.
1518   For example,
1519</preamble><artwork type="example"><![CDATA[
1520  Transfer-Encoding: gzip, chunked
1522   indicates that the payload body has been compressed using the gzip
1523   coding and then chunked using the chunked coding while forming the
1524   message body.
1527   Unlike Content-Encoding (Section of <xref target="RFC7231"/>),
1528   Transfer-Encoding is a property of the message, not of the representation, and
1529   any recipient along the request/response chain MAY decode the received
1530   transfer coding(s) or apply additional transfer coding(s) to the message
1531   body, assuming that corresponding changes are made to the Transfer-Encoding
1532   field-value. Additional information about the encoding parameters can be
1533   provided by other header fields not defined by this specification.
1536   Transfer-Encoding MAY be sent in a response to a HEAD request or in a
1537   304 (Not Modified) response (Section 4.1 of <xref target="RFC7232"/>) to a GET request,
1538   neither of which includes a message body,
1539   to indicate that the origin server would have applied a transfer coding
1540   to the message body if the request had been an unconditional GET.
1541   This indication is not required, however, because any recipient on
1542   the response chain (including the origin server) can remove transfer
1543   codings when they are not needed.
1546   A server MUST NOT send a Transfer-Encoding header field in any response
1547   with a status code of
1548   1xx (Informational) or 204 (No Content).
1549   A server MUST NOT send a Transfer-Encoding header field in any
1550   2xx (Successful) response to a CONNECT request (Section 4.3.6 of <xref target="RFC7231"/>).
1553   Transfer-Encoding was added in HTTP/1.1.  It is generally assumed that
1554   implementations advertising only HTTP/1.0 support will not understand
1555   how to process a transfer-encoded payload.
1556   A client MUST NOT send a request containing Transfer-Encoding unless it
1557   knows the server will handle HTTP/1.1 (or later) requests; such knowledge
1558   might be in the form of specific user configuration or by remembering the
1559   version of a prior received response.
1560   A server MUST NOT send a response containing Transfer-Encoding unless
1561   the corresponding request indicates HTTP/1.1 (or later).
1564   A server that receives a request message with a transfer coding it does
1565   not understand SHOULD respond with 501 (Not Implemented).
1569<section title="Content-Length" anchor="header.content-length">
1570  <iref primary="true" item="Content-Length header field"/>
1573   When a message does not have a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header
1574   field, a Content-Length header field can provide the anticipated size,
1575   as a decimal number of octets, for a potential payload body.
1576   For messages that do include a payload body, the Content-Length field-value
1577   provides the framing information necessary for determining where the body
1578   (and message) ends.  For messages that do not include a payload body, the
1579   Content-Length indicates the size of the selected representation
1580   (Section 3 of <xref target="RFC7231"/>).
1582<figure><iref primary="true" item="Grammar" subitem="Content-Length"/><artwork type="abnf2616"><![CDATA[
1583  Content-Length = 1*DIGIT
1586   An example is
1588<figure><artwork type="example"><![CDATA[
1589  Content-Length: 3495
1592   A sender MUST NOT send a Content-Length header field in any message that
1593   contains a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field.
1596   A user agent SHOULD send a Content-Length in a request message when no
1597   <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> is sent and the request method defines
1598   a meaning for an enclosed payload body. For example, a Content-Length
1599   header field is normally sent in a POST request even when the value is
1600   0 (indicating an empty payload body).  A user agent SHOULD NOT send a
1601   Content-Length header field when the request message does not contain a
1602   payload body and the method semantics do not anticipate such a body.
1605   A server MAY send a Content-Length header field in a response to a HEAD
1606   request (Section 4.3.2 of <xref target="RFC7231"/>); a server MUST NOT send Content-Length in such a
1607   response unless its field-value equals the decimal number of octets that
1608   would have been sent in the payload body of a response if the same
1609   request had used the GET method.
1612   A server MAY send a Content-Length header field in a
1613   304 (Not Modified) response to a conditional GET request
1614   (Section 4.1 of <xref target="RFC7232"/>); a server MUST NOT send Content-Length in such a
1615   response unless its field-value equals the decimal number of octets that
1616   would have been sent in the payload body of a 200 (OK)
1617   response to the same request.
1620   A server MUST NOT send a Content-Length header field in any response
1621   with a status code of
1622   1xx (Informational) or 204 (No Content).
1623   A server MUST NOT send a Content-Length header field in any
1624   2xx (Successful) response to a CONNECT request (Section 4.3.6 of <xref target="RFC7231"/>).
1627   Aside from the cases defined above, in the absence of Transfer-Encoding,
1628   an origin server SHOULD send a Content-Length header field when the
1629   payload body size is known prior to sending the complete header section.
1630   This will allow downstream recipients to measure transfer progress,
1631   know when a received message is complete, and potentially reuse the
1632   connection for additional requests.
1635   Any Content-Length field value greater than or equal to zero is valid.
1636   Since there is no predefined limit to the length of a payload, a
1637   recipient MUST anticipate potentially large decimal numerals and
1638   prevent parsing errors due to integer conversion overflows
1639   (<xref target="attack.protocol.element.length"/>).
1642   If a message is received that has multiple Content-Length header fields
1643   with field-values consisting of the same decimal value, or a single
1644   Content-Length header field with a field value containing a list of
1645   identical decimal values (e.g., "Content-Length: 42, 42"), indicating that
1646   duplicate Content-Length header fields have been generated or combined by an
1647   upstream message processor, then the recipient MUST either reject the
1648   message as invalid or replace the duplicated field-values with a single
1649   valid Content-Length field containing that decimal value prior to
1650   determining the message body length or forwarding the message.
1653  <t>
1654   Note: HTTP's use of Content-Length for message framing differs
1655   significantly from the same field's use in MIME, where it is an optional
1656   field used only within the "message/external-body" media-type.
1657  </t>
1661<section title="Message Body Length" anchor="message.body.length">
1662  <iref item="chunked (Coding Format)"/>
1664   The length of a message body is determined by one of the following
1665   (in order of precedence):
1668  <list style="numbers">
1669    <t>
1670     Any response to a HEAD request and any response with a
1671     1xx (Informational), 204 (No Content), or
1672     304 (Not Modified) status code is always
1673     terminated by the first empty line after the header fields, regardless of
1674     the header fields present in the message, and thus cannot contain a
1675     message body.
1676    </t>
1677    <t>
1678     Any 2xx (Successful) response to a CONNECT request implies that the
1679     connection will become a tunnel immediately after the empty line that
1680     concludes the header fields.  A client MUST ignore any
1681     <xref target="header.content-length" format="none">Content-Length</xref> or <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header
1682     fields received in such a message.
1683    </t>
1684    <t>
1685     If a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field is present
1686     and the chunked transfer coding (<xref target="chunked.encoding"/>)
1687     is the final encoding, the message body length is determined by reading
1688     and decoding the chunked data until the transfer coding indicates the
1689     data is complete.
1690    <vspace blankLines="1"/>
1691     If a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field is present in a
1692     response and the chunked transfer coding is not the final encoding, the
1693     message body length is determined by reading the connection until it is
1694     closed by the server.
1695     If a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field is present in a request and the
1696     chunked transfer coding is not the final encoding, the message body
1697     length cannot be determined reliably; the server MUST respond with
1698     the 400 (Bad Request) status code and then close the connection.
1699    <vspace blankLines="1"/>
1700     If a message is received with both a <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref>
1701     and a <xref target="header.content-length" format="none">Content-Length</xref> header field, the Transfer-Encoding
1702     overrides the Content-Length. Such a message might indicate an attempt to
1703     perform request smuggling (<xref target="request.smuggling"/>) or
1704     response splitting (<xref target="response.splitting"/>) and ought to be
1705     handled as an error. A sender MUST remove the received Content-Length
1706     field prior to forwarding such a message downstream.
1707    </t>
1708    <t>
1709     If a message is received without <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> and with
1710     either multiple <xref target="header.content-length" format="none">Content-Length</xref> header fields having
1711     differing field-values or a single Content-Length header field having an
1712     invalid value, then the message framing is invalid and
1713     the recipient MUST treat it as an unrecoverable error.
1714     If this is a request message, the server MUST respond with
1715     a 400 (Bad Request) status code and then close the connection.
1716     If this is a response message received by a proxy,
1717     the proxy MUST close the connection to the server, discard the received
1718     response, and send a 502 (Bad Gateway) response to the
1719     client.
1720     If this is a response message received by a user agent,
1721     the user agent MUST close the connection to the server and discard the
1722     received response.
1723    </t>
1724    <t>
1725     If a valid <xref target="header.content-length" format="none">Content-Length</xref> header field is present without
1726     <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref>, its decimal value defines the
1727     expected message body length in octets.
1728     If the sender closes the connection or the recipient times out before the
1729     indicated number of octets are received, the recipient MUST consider
1730     the message to be incomplete and close the connection.
1731    </t>
1732    <t>
1733     If this is a request message and none of the above are true, then the
1734     message body length is zero (no message body is present).
1735    </t>
1736    <t>
1737     Otherwise, this is a response message without a declared message body
1738     length, so the message body length is determined by the number of octets
1739     received prior to the server closing the connection.
1740    </t>
1741  </list>
1744   Since there is no way to distinguish a successfully completed,
1745   close-delimited message from a partially received message interrupted
1746   by network failure, a server SHOULD generate encoding or
1747   length-delimited messages whenever possible.  The close-delimiting
1748   feature exists primarily for backwards compatibility with HTTP/1.0.
1751   A server MAY reject a request that contains a message body but
1752   not a <xref target="header.content-length" format="none">Content-Length</xref> by responding with
1753   411 (Length Required).
1756   Unless a transfer coding other than chunked has been applied,
1757   a client that sends a request containing a message body SHOULD
1758   use a valid <xref target="header.content-length" format="none">Content-Length</xref> header field if the message body
1759   length is known in advance, rather than the chunked transfer coding, since some
1760   existing services respond to chunked with a 411 (Length Required)
1761   status code even though they understand the chunked transfer coding.  This
1762   is typically because such services are implemented via a gateway that
1763   requires a content-length in advance of being called and the server
1764   is unable or unwilling to buffer the entire request before processing.
1767   A user agent that sends a request containing a message body MUST send a
1768   valid <xref target="header.content-length" format="none">Content-Length</xref> header field if it does not know the
1769   server will handle HTTP/1.1 (or later) requests; such knowledge can be in
1770   the form of specific user configuration or by remembering the version of a
1771   prior received response.
1774   If the final response to the last request on a connection has been
1775   completely received and there remains additional data to read, a user agent
1776   MAY discard the remaining data or attempt to determine if that data
1777   belongs as part of the prior response body, which might be the case if the
1778   prior message's Content-Length value is incorrect. A client MUST NOT
1779   process, cache, or forward such extra data as a separate response, since
1780   such behavior would be vulnerable to cache poisoning.
1785<section anchor="incomplete.messages" title="Handling Incomplete Messages">
1787   A server that receives an incomplete request message, usually due to a
1788   canceled request or a triggered timeout exception, MAY send an error
1789   response prior to closing the connection.
1792   A client that receives an incomplete response message, which can occur
1793   when a connection is closed prematurely or when decoding a supposedly
1794   chunked transfer coding fails, MUST record the message as incomplete.
1795   Cache requirements for incomplete responses are defined in
1796   Section 3 of <xref target="RFC7234"/>.
1799   If a response terminates in the middle of the header section (before the
1800   empty line is received) and the status code might rely on header fields to
1801   convey the full meaning of the response, then the client cannot assume
1802   that meaning has been conveyed; the client might need to repeat the
1803   request in order to determine what action to take next.
1806   A message body that uses the chunked transfer coding is
1807   incomplete if the zero-sized chunk that terminates the encoding has not
1808   been received.  A message that uses a valid <xref target="header.content-length" format="none">Content-Length</xref> is
1809   incomplete if the size of the message body received (in octets) is less than
1810   the value given by Content-Length.  A response that has neither chunked
1811   transfer coding nor Content-Length is terminated by closure of the
1812   connection and, thus, is considered complete regardless of the number of
1813   message body octets received, provided that the header section was received
1814   intact.
1818<section title="Message Parsing Robustness" anchor="message.robustness">
1820   Older HTTP/1.0 user agent implementations might send an extra CRLF
1821   after a POST request as a workaround for some early server
1822   applications that failed to read message body content that was
1823   not terminated by a line-ending. An HTTP/1.1 user agent MUST NOT
1824   preface or follow a request with an extra CRLF.  If terminating
1825   the request message body with a line-ending is desired, then the
1826   user agent MUST count the terminating CRLF octets as part of the
1827   message body length.
1830   In the interest of robustness, a server that is expecting to receive and
1831   parse a request-line SHOULD ignore at least one empty line (CRLF)
1832   received prior to the request-line.
1835   Although the line terminator for the start-line and header
1836   fields is the sequence CRLF, a recipient MAY recognize a
1837   single LF as a line terminator and ignore any preceding CR.
1840   Although the request-line and status-line grammar rules require that each
1841   of the component elements be separated by a single SP octet, recipients
1842   MAY instead parse on whitespace-delimited word boundaries and, aside
1843   from the CRLF terminator, treat any form of whitespace as the SP separator
1844   while ignoring preceding or trailing whitespace;
1845   such whitespace includes one or more of the following octets:
1846   SP, HTAB, VT (%x0B), FF (%x0C), or bare CR.
1847   However, lenient parsing can result in security vulnerabilities if there
1848   are multiple recipients of the message and each has its own unique
1849   interpretation of robustness (see <xref target="request.smuggling"/>).
1852   When a server listening only for HTTP request messages, or processing
1853   what appears from the start-line to be an HTTP request message,
1854   receives a sequence of octets that does not match the HTTP-message
1855   grammar aside from the robustness exceptions listed above, the
1856   server SHOULD respond with a 400 (Bad Request) response. 
1861<section title="Transfer Codings" anchor="transfer.codings">
1865   Transfer coding names are used to indicate an encoding
1866   transformation that has been, can be, or might need to be applied to a
1867   payload body in order to ensure "safe transport" through the network.
1868   This differs from a content coding in that the transfer coding is a
1869   property of the message rather than a property of the representation
1870   that is being transferred.
1872<figure><iref primary="true" item="Grammar" subitem="transfer-coding"/><iref primary="true" item="Grammar" subitem="transfer-extension"/><artwork type="abnf2616"><![CDATA[
1873  transfer-coding    = "chunked" ; Section 4.1
1874                     / "compress" ; Section 4.2.1
1875                     / "deflate" ; Section 4.2.2
1876                     / "gzip" ; Section 4.2.3
1877                     / transfer-extension
1878  transfer-extension = token *( OWS ";" OWS transfer-parameter )
1880<t anchor="rule.parameter">
1882   Parameters are in the form of a name or name=value pair.
1884<figure><iref primary="true" item="Grammar" subitem="transfer-parameter"/><artwork type="abnf2616"><![CDATA[
1885  transfer-parameter = token BWS "=" BWS ( token / quoted-string )
1888   All transfer-coding names are case-insensitive and ought to be registered
1889   within the HTTP Transfer Coding registry, as defined in
1890   <xref target="transfer.coding.registry"/>.
1891   They are used in the <xref target="header.te" format="none">TE</xref> (<xref target="header.te"/>) and
1892   <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> (<xref target="header.transfer-encoding"/>)
1893   header fields.
1896<section title="Chunked Transfer Coding" anchor="chunked.encoding">
1897  <iref primary="true" item="chunked (Coding Format)"/>
1904   The chunked transfer coding wraps the payload body in order to transfer it
1905   as a series of chunks, each with its own size indicator, followed by an
1906   OPTIONAL trailer containing header fields. Chunked enables content
1907   streams of unknown size to be transferred as a sequence of length-delimited
1908   buffers, which enables the sender to retain connection persistence and the
1909   recipient to know when it has received the entire message.
1911<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[
1912  chunked-body   = *chunk
1913                   last-chunk
1914                   trailer-part
1915                   CRLF
1917  chunk          = chunk-size [ chunk-ext ] CRLF
1918                   chunk-data CRLF
1919  chunk-size     = 1*HEXDIG
1920  last-chunk     = 1*("0") [ chunk-ext ] CRLF
1922  chunk-data     = 1*OCTET ; a sequence of chunk-size octets
1925   The chunk-size field is a string of hex digits indicating the size of
1926   the chunk-data in octets. The chunked transfer coding is complete when a
1927   chunk with a chunk-size of zero is received, possibly followed by a
1928   trailer, and finally terminated by an empty line.
1931   A recipient MUST be able to parse and decode the chunked transfer coding.
1934<section title="Chunk Extensions" anchor="chunked.extension">
1939   The chunked encoding allows each chunk to include zero or more chunk
1940   extensions, immediately following the <xref target="chunked.encoding" format="none">chunk-size</xref>, for the
1941   sake of supplying per-chunk metadata (such as a signature or hash),
1942   mid-message control information, or randomization of message body size.
1944<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[
1945  chunk-ext      = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
1947  chunk-ext-name = token
1948  chunk-ext-val  = token / quoted-string
1951   The chunked encoding is specific to each connection and is likely to be
1952   removed or recoded by each recipient (including intermediaries) before any
1953   higher-level application would have a chance to inspect the extensions.
1954   Hence, use of chunk extensions is generally limited to specialized HTTP
1955   services such as "long polling" (where client and server can have shared
1956   expectations regarding the use of chunk extensions) or for padding within
1957   an end-to-end secured connection.
1960   A recipient MUST ignore unrecognized chunk extensions.
1961   A server ought to limit the total length of chunk extensions received in a
1962   request to an amount reasonable for the services provided, in the same way
1963   that it applies length limitations and timeouts for other parts of a
1964   message, and generate an appropriate 4xx (Client Error)
1965   response if that amount is exceeded.
1969<section title="Chunked Trailer Part" anchor="chunked.trailer.part">
1972   A trailer allows the sender to include additional fields at the end of a
1973   chunked message in order to supply metadata that might be dynamically
1974   generated while the message body is sent, such as a message integrity
1975   check, digital signature, or post-processing status. The trailer fields are
1976   identical to header fields, except they are sent in a chunked trailer
1977   instead of the message's header section.
1979<figure><iref primary="true" item="Grammar" subitem="trailer-part"/><iref primary="false" item="Grammar" subitem="header-field"/><artwork type="abnf2616"><![CDATA[
1980  trailer-part   = *( header-field CRLF )
1983   A sender MUST NOT generate a trailer that contains a field necessary for
1984   message framing (e.g., <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> and
1985   <xref target="header.content-length" format="none">Content-Length</xref>), routing (e.g., <xref target="" format="none">Host</xref>),
1986   request modifiers (e.g., controls and conditionals in
1987   Section 5 of <xref target="RFC7231"/>), authentication (e.g., see <xref target="RFC7235"/>
1988   and <xref target="RFC6265"/>), response control data (e.g., see
1989   Section 7.1 of <xref target="RFC7231"/>), or determining how to process the payload
1990   (e.g., Content-Encoding, Content-Type,
1991   Content-Range, and <xref target="header.trailer" format="none">Trailer</xref>).
1994   When a chunked message containing a non-empty trailer is received, the
1995   recipient MAY process the fields (aside from those forbidden above)
1996   as if they were appended to the message's header section.
1997   A recipient MUST ignore (or consider as an error) any fields that are
1998   forbidden to be sent in a trailer, since processing them as if they were
1999   present in the header section might bypass external security filters.
2002   Unless the request includes a <xref target="header.te" format="none">TE</xref> header field indicating
2003   "trailers" is acceptable, as described in <xref target="header.te"/>, a
2004   server SHOULD NOT generate trailer fields that it believes are necessary
2005   for the user agent to receive. Without a TE containing "trailers", the
2006   server ought to assume that the trailer fields might be silently discarded
2007   along the path to the user agent. This requirement allows intermediaries to
2008   forward a de-chunked message to an HTTP/1.0 recipient without buffering the
2009   entire response.
2013<section title="Decoding Chunked" anchor="decoding.chunked">
2015   A process for decoding the chunked transfer coding
2016   can be represented in pseudo-code as:
2018<figure><artwork type="code"><![CDATA[
2019  length := 0
2020  read chunk-size, chunk-ext (if any), and CRLF
2021  while (chunk-size > 0) {
2022     read chunk-data and CRLF
2023     append chunk-data to decoded-body
2024     length := length + chunk-size
2025     read chunk-size, chunk-ext (if any), and CRLF
2026  }
2027  read trailer field
2028  while (trailer field is not empty) {
2029     if (trailer field is allowed to be sent in a trailer) {
2030         append trailer field to existing header fields
2031     }
2032     read trailer-field
2033  }
2034  Content-Length := length
2035  Remove "chunked" from Transfer-Encoding
2036  Remove Trailer from existing header fields
2041<section title="Compression Codings" anchor="compression.codings">
2043   The codings defined below can be used to compress the payload of a
2044   message.
2047<section title="Compress Coding" anchor="compress.coding">
2048<iref item="compress (Coding Format)"/>
2050   The "compress" coding is an adaptive Lempel-Ziv-Welch (LZW) coding
2051   <xref target="Welch"/> that is commonly produced by the UNIX file
2052   compression program "compress".
2053   A recipient SHOULD consider "x-compress" to be equivalent to "compress".
2057<section title="Deflate Coding" anchor="deflate.coding">
2058<iref item="deflate (Coding Format)"/>
2060   The "deflate" coding is a "zlib" data format <xref target="RFC1950"/>
2061   containing a "deflate" compressed data stream <xref target="RFC1951"/>
2062   that uses a combination of the Lempel-Ziv (LZ77) compression algorithm and
2063   Huffman coding.
2066  <t>
2067    Note: Some non-conformant implementations send the "deflate"
2068    compressed data without the zlib wrapper.
2069   </t>
2073<section title="Gzip Coding" anchor="gzip.coding">
2074<iref item="gzip (Coding Format)"/>
2076   The "gzip" coding is an LZ77 coding with a 32-bit Cyclic Redundancy Check
2077   (CRC) that is commonly
2078   produced by the gzip file compression program <xref target="RFC1952"/>.
2079   A recipient SHOULD consider "x-gzip" to be equivalent to "gzip".
2085<section title="TE" anchor="header.te">
2086  <iref primary="true" item="TE header field"/>
2092   The "TE" header field in a request indicates what transfer codings,
2093   besides chunked, the client is willing to accept in response, and
2094   whether or not the client is willing to accept trailer fields in a
2095   chunked transfer coding.
2098   The TE field-value consists of a comma-separated list of transfer coding
2099   names, each allowing for optional parameters (as described in
2100   <xref target="transfer.codings"/>), and/or the keyword "trailers".
2101   A client MUST NOT send the chunked transfer coding name in TE;
2102   chunked is always acceptable for HTTP/1.1 recipients.
2104<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[
2105  TE        = #t-codings
2106  t-codings = "trailers" / ( transfer-coding [ t-ranking ] )
2107  t-ranking = OWS ";" OWS "q=" rank
2108  rank      = ( "0" [ "." 0*3DIGIT ] )
2109             / ( "1" [ "." 0*3("0") ] )
2112   Three examples of TE use are below.
2114<figure><artwork type="example"><![CDATA[
2115  TE: deflate
2116  TE:
2117  TE: trailers, deflate;q=0.5
2120   The presence of the keyword "trailers" indicates that the client is willing
2121   to accept trailer fields in a chunked transfer coding, as defined in
2122   <xref target="chunked.trailer.part"/>, on behalf of itself and any downstream
2123   clients. For requests from an intermediary, this implies that either:
2124   (a) all downstream clients are willing to accept trailer fields in the
2125   forwarded response; or,
2126   (b) the intermediary will attempt to buffer the response on behalf of
2127   downstream recipients.
2128   Note that HTTP/1.1 does not define any means to limit the size of a
2129   chunked response such that an intermediary can be assured of buffering the
2130   entire response.
2133   When multiple transfer codings are acceptable, the client MAY rank the
2134   codings by preference using a case-insensitive "q" parameter (similar to
2135   the qvalues used in content negotiation fields, Section 5.3.1 of <xref target="RFC7231"/>). The rank value
2136   is a real number in the range 0 through 1, where 0.001 is the least
2137   preferred and 1 is the most preferred; a value of 0 means "not acceptable".
2140   If the TE field-value is empty or if no TE field is present, the only
2141   acceptable transfer coding is chunked. A message with no transfer coding
2142   is always acceptable.
2145   Since the TE header field only applies to the immediate connection,
2146   a sender of TE MUST also send a "TE" connection option within the
2147   <xref target="header.connection" format="none">Connection</xref> header field (<xref target="header.connection"/>)
2148   in order to prevent the TE field from being forwarded by intermediaries
2149   that do not support its semantics.
2153<section title="Trailer" anchor="header.trailer">
2154  <iref primary="true" item="Trailer header field"/>
2157   When a message includes a message body encoded with the chunked
2158   transfer coding and the sender desires to send metadata in the form of
2159   trailer fields at the end of the message, the sender SHOULD generate a
2160   <xref target="header.trailer" format="none">Trailer</xref> header field before the message body to indicate
2161   which fields will be present in the trailers. This allows the recipient
2162   to prepare for receipt of that metadata before it starts processing the body,
2163   which is useful if the message is being streamed and the recipient wishes
2164   to confirm an integrity check on the fly.
2166<figure><iref primary="true" item="Grammar" subitem="Trailer"/><iref primary="false" item="Grammar" subitem="field-name"/><artwork type="abnf2616"><![CDATA[
2167  Trailer = 1#field-name
2172<section title="Message Routing" anchor="message.routing">
2174   HTTP request message routing is determined by each client based on the
2175   target resource, the client's proxy configuration, and
2176   establishment or reuse of an inbound connection.  The corresponding
2177   response routing follows the same connection chain back to the client.
2180<section title="Identifying a Target Resource" anchor="target-resource">
2181  <iref primary="true" item="target resource"/>
2182  <iref primary="true" item="target URI"/>
2186   HTTP is used in a wide variety of applications, ranging from
2187   general-purpose computers to home appliances.  In some cases,
2188   communication options are hard-coded in a client's configuration.
2189   However, most HTTP clients rely on the same resource identification
2190   mechanism and configuration techniques as general-purpose Web browsers.
2193   HTTP communication is initiated by a user agent for some purpose.
2194   The purpose is a combination of request semantics, which are defined in
2195   <xref target="RFC7231"/>, and a target resource upon which to apply those
2196   semantics.  A URI reference (<xref target="uri"/>) is typically used as
2197   an identifier for the "target resource", which a user agent
2198   would resolve to its absolute form in order to obtain the
2199   "target URI".  The target URI
2200   excludes the reference's fragment component, if any,
2201   since fragment identifiers are reserved for client-side processing
2202   (<xref target="RFC3986"/>, Section 3.5).
2206<section title="Connecting Inbound" anchor="connecting.inbound">
2208   Once the target URI is determined, a client needs to decide whether
2209   a network request is necessary to accomplish the desired semantics and,
2210   if so, where that request is to be directed.
2213   If the client has a cache <xref target="RFC7234"/> and the request can be
2214   satisfied by it, then the request is
2215   usually directed there first.
2218   If the request is not satisfied by a cache, then a typical client will
2219   check its configuration to determine whether a proxy is to be used to
2220   satisfy the request.  Proxy configuration is implementation-dependent,
2221   but is often based on URI prefix matching, selective authority matching,
2222   or both, and the proxy itself is usually identified by an "http" or
2223   "https" URI.  If a proxy is applicable, the client connects inbound by
2224   establishing (or reusing) a connection to that proxy.
2227   If no proxy is applicable, a typical client will invoke a handler routine,
2228   usually specific to the target URI's scheme, to connect directly
2229   to an authority for the target resource.  How that is accomplished is
2230   dependent on the target URI scheme and defined by its associated
2231   specification, similar to how this specification defines origin server
2232   access for resolution of the "http" (<xref target="http.uri"/>) and
2233   "https" (<xref target="https.uri"/>) schemes.
2236   HTTP requirements regarding connection management are defined in
2237   <xref target=""/>.
2241<section title="Request Target" anchor="request-target">
2243   Once an inbound connection is obtained,
2244   the client sends an HTTP request message (<xref target="http.message"/>)
2245   with a request-target derived from the target URI.
2246   There are four distinct formats for the request-target, depending on both
2247   the method being requested and whether the request is to a proxy.
2249<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[
2250  request-target = origin-form
2251                 / absolute-form
2252                 / authority-form
2253                 / asterisk-form
2256<section title="origin-form" anchor="origin-form">
2257   <iref item="origin-form (of request-target)"/>
2259   The most common form of request-target is the origin-form.
2261<figure><iref primary="true" item="Grammar" subitem="origin-form"/><artwork type="abnf2616"><![CDATA[
2262  origin-form    = absolute-path [ "?" query ]
2265   When making a request directly to an origin server, other than a CONNECT
2266   or server-wide OPTIONS request (as detailed below),
2267   a client MUST send only the absolute path and query components of
2268   the target URI as the request-target.
2269   If the target URI's path component is empty, the client MUST send
2270   "/" as the path within the origin-form of request-target.
2271   A <xref target="" format="none">Host</xref> header field is also sent, as defined in
2272   <xref target=""/>.
2275   For example, a client wishing to retrieve a representation of the resource
2276   identified as
2278<figure><artwork type="example"><![CDATA[
2280  ]]></artwork></figure>
2282   directly from the origin server would open (or reuse) a TCP connection
2283   to port 80 of the host "" and send the lines:
2285<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2286  GET /where?q=now HTTP/1.1
2287  Host:
2288  ]]></artwork></figure>
2290   followed by the remainder of the request message.
2294<section title="absolute-form" anchor="absolute-form">
2295   <iref item="absolute-form (of request-target)"/>
2297   When making a request to a proxy, other than a CONNECT or server-wide
2298   OPTIONS request (as detailed below), a client MUST send the target URI
2299   in absolute-form as the request-target.
2301<figure><iref primary="true" item="Grammar" subitem="absolute-form"/><artwork type="abnf2616"><![CDATA[
2302  absolute-form  = absolute-URI
2305   The proxy is requested to either service that request from a valid cache,
2306   if possible, or make the same request on the client's behalf to either
2307   the next inbound proxy server or directly to the origin server indicated
2308   by the request-target.  Requirements on such "forwarding" of messages are
2309   defined in <xref target="message.forwarding"/>.
2312   An example absolute-form of request-line would be:
2314<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2315  GET HTTP/1.1
2316  ]]></artwork></figure>
2318   To allow for transition to the absolute-form for all requests in some
2319   future version of HTTP, a server MUST accept the absolute-form
2320   in requests, even though HTTP/1.1 clients will only send them in requests
2321   to proxies.
2325<section title="authority-form" anchor="authority-form">
2326   <iref item="authority-form (of request-target)"/>
2328   The authority-form of request-target is only used for
2329   CONNECT requests (Section 4.3.6 of <xref target="RFC7231"/>).
2331<figure><iref primary="true" item="Grammar" subitem="authority-form"/><artwork type="abnf2616"><![CDATA[
2332  authority-form = authority
2335   When making a CONNECT request to establish a
2336   tunnel through one or more proxies, a client MUST send only the target
2337   URI's authority component (excluding any userinfo and its "@" delimiter) as
2338   the request-target. For example,
2340<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2341  CONNECT HTTP/1.1
2342  ]]></artwork></figure>
2345<section title="asterisk-form" anchor="asterisk-form">
2346   <iref item="asterisk-form (of request-target)"/>
2348   The asterisk-form of request-target is only used for a server-wide
2349   OPTIONS request (Section 4.3.7 of <xref target="RFC7231"/>).
2351<figure><iref primary="true" item="Grammar" subitem="asterisk-form"/><artwork type="abnf2616"><![CDATA[
2352  asterisk-form  = "*"
2355   When a client wishes to request OPTIONS
2356   for the server as a whole, as opposed to a specific named resource of
2357   that server, the client MUST send only "*" (%x2A) as the request-target.
2358   For example,
2360<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2361  OPTIONS * HTTP/1.1
2362  ]]></artwork></figure>
2364   If a proxy receives an OPTIONS request with an absolute-form of
2365   request-target in which the URI has an empty path and no query component,
2366   then the last proxy on the request chain MUST send a request-target
2367   of "*" when it forwards the request to the indicated origin server.
2370   For example, the request
2371</preamble><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2372  OPTIONS HTTP/1.1
2373  ]]></artwork></figure>
2375  would be forwarded by the final proxy as
2376</preamble><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2377  OPTIONS * HTTP/1.1
2378  Host:
2379  ]]></artwork>
2381   after connecting to port 8001 of host "".
2387<section title="Host" anchor="">
2388  <iref primary="true" item="Host header field"/>
2391   The "Host" header field in a request provides the host and port
2392   information from the target URI, enabling the origin
2393   server to distinguish among resources while servicing requests
2394   for multiple host names on a single IP address.
2396<figure><iref primary="true" item="Grammar" subitem="Host"/><artwork type="abnf2616"><![CDATA[
2397  Host = uri-host [ ":" port ] ; Section 2.7.1
2400   A client MUST send a Host header field in all HTTP/1.1 request messages.
2401   If the target URI includes an authority component, then a client MUST
2402   send a field-value for Host that is identical to that authority
2403   component, excluding any userinfo subcomponent and its "@" delimiter
2404   (<xref target="http.uri"/>).
2405   If the authority component is missing or undefined for the target URI,
2406   then a client MUST send a Host header field with an empty field-value.
2409   Since the Host field-value is critical information for handling a request,
2410   a user agent SHOULD generate Host as the first header field following the
2411   request-line.
2414   For example, a GET request to the origin server for
2415   &lt;; would begin with:
2417<figure><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
2418  GET /pub/WWW/ HTTP/1.1
2419  Host:
2420  ]]></artwork></figure>
2422   A client MUST send a Host header field in an HTTP/1.1 request even
2423   if the request-target is in the absolute-form, since this
2424   allows the Host information to be forwarded through ancient HTTP/1.0
2425   proxies that might not have implemented Host.
2428   When a proxy receives a request with an absolute-form of
2429   request-target, the proxy MUST ignore the received
2430   Host header field (if any) and instead replace it with the host
2431   information of the request-target.  A proxy that forwards such a request
2432   MUST generate a new Host field-value based on the received
2433   request-target rather than forward the received Host field-value.
2436   Since the Host header field acts as an application-level routing
2437   mechanism, it is a frequent target for malware seeking to poison
2438   a shared cache or redirect a request to an unintended server.
2439   An interception proxy is particularly vulnerable if it relies on
2440   the Host field-value for redirecting requests to internal
2441   servers, or for use as a cache key in a shared cache, without
2442   first verifying that the intercepted connection is targeting a
2443   valid IP address for that host.
2446   A server MUST respond with a 400 (Bad Request) status code
2447   to any HTTP/1.1 request message that lacks a Host header field and
2448   to any request message that contains more than one Host header field
2449   or a Host header field with an invalid field-value.
2453<section title="Effective Request URI" anchor="effective.request.uri">
2454  <iref primary="true" item="effective request URI"/>
2457   Since the request-target often contains only part of the user agent's
2458   target URI, a server reconstructs the intended target as an
2459   "effective request URI" to properly service the request.
2460   This reconstruction involves both the server's local configuration and
2461   information communicated in the <xref target="request-target" format="none">request-target</xref>,
2462   <xref target="" format="none">Host</xref> header field, and connection context.
2465   For a user agent, the effective request URI is the target URI.
2468   If the <xref target="request-target" format="none">request-target</xref> is in <xref target="absolute-form" format="none">absolute-form</xref>,
2469   the effective request URI is the same as the request-target. Otherwise, the
2470   effective request URI is constructed as follows:
2471<list style="empty">
2473   If the server's configuration (or outbound gateway) provides a fixed URI
2474   <xref target="uri" format="none">scheme</xref>, that scheme is used for the effective request URI.
2475   Otherwise, if the request is received over a TLS-secured TCP connection,
2476   the effective request URI's scheme is "https"; if not, the scheme is "http".
2479   If the server's configuration (or outbound gateway) provides a fixed URI
2480   <xref target="uri" format="none">authority</xref> component, that authority is used for the
2481   effective request URI. If not, then if the request-target is in
2482   <xref target="authority-form" format="none">authority-form</xref>, the effective request URI's authority
2483   component is the same as the request-target.
2484   If not, then if a <xref target="" format="none">Host</xref> header field is supplied with a
2485   non-empty field-value, the authority component is the same as the
2486   Host field-value. Otherwise, the authority component is assigned
2487   the default name configured for the server and, if the connection's
2488   incoming TCP port number differs from the default port for the effective
2489   request URI's scheme, then a colon (":") and the incoming port number (in
2490   decimal form) are appended to the authority component.
2493   If the request-target is in <xref target="authority-form" format="none">authority-form</xref> or
2494   <xref target="asterisk-form" format="none">asterisk-form</xref>, the effective request URI's combined
2495   <xref target="uri" format="none">path</xref> and <xref target="uri" format="none">query</xref> component is empty. Otherwise,
2496   the combined <xref target="uri" format="none">path</xref> and <xref target="uri" format="none">query</xref> component is the
2497   same as the request-target.
2500   The components of the effective request URI, once determined as above, can
2501   be combined into <xref target="uri" format="none">absolute-URI</xref> form by concatenating the
2502   scheme, "://", authority, and combined path and query component.
2508   Example 1: the following message received over an insecure TCP connection
2510<artwork type="example"><![CDATA[
2511  GET /pub/WWW/TheProject.html HTTP/1.1
2512  Host:
2513  ]]></artwork>
2517  has an effective request URI of
2519<artwork type="example"><![CDATA[
2521  ]]></artwork>
2525   Example 2: the following message received over a TLS-secured TCP connection
2527<artwork type="example"><![CDATA[
2528  OPTIONS * HTTP/1.1
2529  Host:
2530  ]]></artwork>
2534  has an effective request URI of
2536<artwork type="example"><![CDATA[
2538  ]]></artwork>
2541   Recipients of an HTTP/1.0 request that lacks a <xref target="" format="none">Host</xref> header
2542   field might need to use heuristics (e.g., examination of the URI path for
2543   something unique to a particular host) in order to guess the
2544   effective request URI's authority component.
2547   Once the effective request URI has been constructed, an origin server needs
2548   to decide whether or not to provide service for that URI via the connection
2549   in which the request was received. For example, the request might have been
2550   misdirected, deliberately or accidentally, such that the information within
2551   a received <xref target="request-target" format="none">request-target</xref> or <xref target="" format="none">Host</xref> header
2552   field differs from the host or port upon which the connection has been
2553   made. If the connection is from a trusted gateway, that inconsistency might
2554   be expected; otherwise, it might indicate an attempt to bypass security
2555   filters, trick the server into delivering non-public content, or poison a
2556   cache. See <xref target="security.considerations"/> for security
2557   considerations regarding message routing.
2561<section title="Associating a Response to a Request" anchor="">
2563   HTTP does not include a request identifier for associating a given
2564   request message with its corresponding one or more response messages.
2565   Hence, it relies on the order of response arrival to correspond exactly
2566   to the order in which requests are made on the same connection.
2567   More than one response message per request only occurs when one or more
2568   informational responses (1xx, see Section 6.2 of <xref target="RFC7231"/>) precede a
2569   final response to the same request.
2572   A client that has more than one outstanding request on a connection MUST
2573   maintain a list of outstanding requests in the order sent and MUST
2574   associate each received response message on that connection to the highest
2575   ordered request that has not yet received a final (non-1xx)
2576   response.
2580<section title="Message Forwarding" anchor="message.forwarding">
2582   As described in <xref target="intermediaries"/>, intermediaries can serve
2583   a variety of roles in the processing of HTTP requests and responses.
2584   Some intermediaries are used to improve performance or availability.
2585   Others are used for access control or to filter content.
2586   Since an HTTP stream has characteristics similar to a pipe-and-filter
2587   architecture, there are no inherent limits to the extent an intermediary
2588   can enhance (or interfere) with either direction of the stream.
2591   An intermediary not acting as a tunnel MUST implement the
2592   <xref target="header.connection" format="none">Connection</xref> header field, as specified in
2593   <xref target="header.connection"/>, and exclude fields from being forwarded
2594   that are only intended for the incoming connection.
2597   An intermediary MUST NOT forward a message to itself unless it is
2598   protected from an infinite request loop. In general, an intermediary ought
2599   to recognize its own server names, including any aliases, local variations,
2600   or literal IP addresses, and respond to such requests directly.
2603<section title="Via" anchor="header.via">
2604  <iref primary="true" item="Via header field"/>
2610   The "Via" header field indicates the presence of intermediate protocols and
2611   recipients between the user agent and the server (on requests) or between
2612   the origin server and the client (on responses), similar to the
2613   "Received" header field in email
2614   (Section 3.6.7 of <xref target="RFC5322"/>).
2615   Via can be used for tracking message forwards,
2616   avoiding request loops, and identifying the protocol capabilities of
2617   senders along the request/response chain.
2619<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[
2620  Via = 1#( received-protocol RWS received-by [ RWS comment ] )
2622  received-protocol = [ protocol-name "/" ] protocol-version
2623                      ; see Section 6.7
2624  received-by       = ( uri-host [ ":" port ] ) / pseudonym
2625  pseudonym         = token
2628   Multiple Via field values represent each proxy or gateway that has
2629   forwarded the message. Each intermediary appends its own information
2630   about how the message was received, such that the end result is ordered
2631   according to the sequence of forwarding recipients.
2634   A proxy MUST send an appropriate Via header field, as described below, in
2635   each message that it forwards.
2636   An HTTP-to-HTTP gateway MUST send an appropriate Via header field in
2637   each inbound request message and MAY send a Via header field in
2638   forwarded response messages.
2641   For each intermediary, the received-protocol indicates the protocol and
2642   protocol version used by the upstream sender of the message. Hence, the
2643   Via field value records the advertised protocol capabilities of the
2644   request/response chain such that they remain visible to downstream
2645   recipients; this can be useful for determining what backwards-incompatible
2646   features might be safe to use in response, or within a later request, as
2647   described in <xref target="http.version"/>. For brevity, the protocol-name
2648   is omitted when the received protocol is HTTP.
2651   The received-by portion of the field value is normally the host and optional
2652   port number of a recipient server or client that subsequently forwarded the
2653   message.
2654   However, if the real host is considered to be sensitive information, a
2655   sender MAY replace it with a pseudonym. If a port is not provided,
2656   a recipient MAY interpret that as meaning it was received on the default
2657   TCP port, if any, for the received-protocol.
2660   A sender MAY generate comments in the Via header field to identify the
2661   software of each recipient, analogous to the User-Agent and
2662   Server header fields. However, all comments in the Via field
2663   are optional, and a recipient MAY remove them prior to forwarding the
2664   message.
2667   For example, a request message could be sent from an HTTP/1.0 user
2668   agent to an internal proxy code-named "fred", which uses HTTP/1.1 to
2669   forward the request to a public proxy at, which completes
2670   the request by forwarding it to the origin server at
2671   The request received by would then have the following
2672   Via header field:
2674<figure><artwork type="example"><![CDATA[
2675  Via: 1.0 fred, 1.1
2678   An intermediary used as a portal through a network firewall
2679   SHOULD NOT forward the names and ports of hosts within the firewall
2680   region unless it is explicitly enabled to do so. If not enabled, such an
2681   intermediary SHOULD replace each received-by host of any host behind the
2682   firewall by an appropriate pseudonym for that host.
2685   An intermediary MAY combine an ordered subsequence of Via header
2686   field entries into a single such entry if the entries have identical
2687   received-protocol values. For example,
2689<figure><artwork type="example"><![CDATA[
2690  Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy
2693  could be collapsed to
2695<figure><artwork type="example"><![CDATA[
2696  Via: 1.0 ricky, 1.1 mertz, 1.0 lucy
2699   A sender SHOULD NOT combine multiple entries unless they are all
2700   under the same organizational control and the hosts have already been
2701   replaced by pseudonyms. A sender MUST NOT combine entries that
2702   have different received-protocol values.
2706<section title="Transformations" anchor="message.transformations">
2707   <iref primary="true" item="transforming proxy"/>
2708   <iref primary="true" item="non-transforming proxy"/>
2710   Some intermediaries include features for transforming messages and their
2711   payloads. A proxy might, for example, convert between image formats in
2712   order to save cache space or to reduce the amount of traffic on a slow
2713   link. However, operational problems might occur when these transformations
2714   are applied to payloads intended for critical applications, such as medical
2715   imaging or scientific data analysis, particularly when integrity checks or
2716   digital signatures are used to ensure that the payload received is
2717   identical to the original.
2720   An HTTP-to-HTTP proxy is called a "transforming proxy"
2721   if it is designed or configured to modify messages in a semantically
2722   meaningful way (i.e., modifications, beyond those required by normal
2723   HTTP processing, that change the message in a way that would be
2724   significant to the original sender or potentially significant to
2725   downstream recipients).  For example, a transforming proxy might be
2726   acting as a shared annotation server (modifying responses to include
2727   references to a local annotation database), a malware filter, a
2728   format transcoder, or a privacy filter. Such transformations are presumed
2729   to be desired by whichever client (or client organization) selected the
2730   proxy.
2733   If a proxy receives a request-target with a host name that is not a
2734   fully qualified domain name, it MAY add its own domain to the host name
2735   it received when forwarding the request.  A proxy MUST NOT change the
2736   host name if the request-target contains a fully qualified domain name.
2739   A proxy MUST NOT modify the "absolute-path" and "query" parts of the
2740   received request-target when forwarding it to the next inbound server,
2741   except as noted above to replace an empty path with "/" or "*".
2744   A proxy MAY modify the message body through application
2745   or removal of a transfer coding (<xref target="transfer.codings"/>).
2748   A proxy MUST NOT transform the payload (Section 3.3 of <xref target="RFC7231"/>) of a message that
2749   contains a no-transform cache-control directive (Section 5.2 of <xref target="RFC7234"/>).
2752   A proxy MAY transform the payload of a message
2753   that does not contain a no-transform cache-control directive.
2754   A proxy that transforms a payload MUST add a Warning
2755   header field with the warn-code of 214 ("Transformation Applied")
2756   if one is not already in the message (see Section 5.5 of <xref target="RFC7234"/>).
2757   A proxy that transforms the payload of a 200 (OK) response
2758   can further inform downstream recipients that a transformation has been
2759   applied by changing the response status code to
2760   203 (Non-Authoritative Information) (Section 6.3.4 of <xref target="RFC7231"/>).
2763   A proxy SHOULD NOT modify header fields that provide information about
2764   the endpoints of the communication chain, the resource state, or the
2765   selected representation (other than the payload) unless the field's
2766   definition specifically allows such modification or the modification is
2767   deemed necessary for privacy or security.
2773<section title="Connection Management" anchor="">
2775   HTTP messaging is independent of the underlying transport- or
2776   session-layer connection protocol(s).  HTTP only presumes a reliable
2777   transport with in-order delivery of requests and the corresponding
2778   in-order delivery of responses.  The mapping of HTTP request and
2779   response structures onto the data units of an underlying transport
2780   protocol is outside the scope of this specification.
2783   As described in <xref target="connecting.inbound"/>, the specific
2784   connection protocols to be used for an HTTP interaction are determined by
2785   client configuration and the <xref target="target-resource" format="none">target URI</xref>.
2786   For example, the "http" URI scheme
2787   (<xref target="http.uri"/>) indicates a default connection of TCP
2788   over IP, with a default TCP port of 80, but the client might be
2789   configured to use a proxy via some other connection, port, or protocol.
2792   HTTP implementations are expected to engage in connection management,
2793   which includes maintaining the state of current connections,
2794   establishing a new connection or reusing an existing connection,
2795   processing messages received on a connection, detecting connection
2796   failures, and closing each connection.
2797   Most clients maintain multiple connections in parallel, including
2798   more than one connection per server endpoint.
2799   Most servers are designed to maintain thousands of concurrent connections,
2800   while controlling request queues to enable fair use and detect
2801   denial-of-service attacks.
2804<section title="Connection" anchor="header.connection">
2805  <iref primary="true" item="Connection header field"/>
2806  <iref primary="true" item="close"/>
2811   The "Connection" header field allows the sender to indicate desired
2812   control options for the current connection.  In order to avoid confusing
2813   downstream recipients, a proxy or gateway MUST remove or replace any
2814   received connection options before forwarding the message.
2817   When a header field aside from Connection is used to supply control
2818   information for or about the current connection, the sender MUST list
2819   the corresponding field-name within the Connection header field.
2820   A proxy or gateway MUST parse a received Connection
2821   header field before a message is forwarded and, for each
2822   connection-option in this field, remove any header field(s) from
2823   the message with the same name as the connection-option, and then
2824   remove the Connection header field itself (or replace it with the
2825   intermediary's own connection options for the forwarded message).
2828   Hence, the Connection header field provides a declarative way of
2829   distinguishing header fields that are only intended for the
2830   immediate recipient ("hop-by-hop") from those fields that are
2831   intended for all recipients on the chain ("end-to-end"), enabling the
2832   message to be self-descriptive and allowing future connection-specific
2833   extensions to be deployed without fear that they will be blindly
2834   forwarded by older intermediaries.
2837   The Connection header field's value has the following grammar:
2839<figure><iref primary="true" item="Grammar" subitem="Connection"/><iref primary="true" item="Grammar" subitem="connection-option"/><artwork type="abnf2616"><![CDATA[
2840  Connection        = 1#connection-option
2841  connection-option = token
2844   Connection options are case-insensitive.
2847   A sender MUST NOT send a connection option corresponding to a header
2848   field that is intended for all recipients of the payload.
2849   For example, Cache-Control is never appropriate as a
2850   connection option (Section 5.2 of <xref target="RFC7234"/>).
2853   The connection options do not always correspond to a header field
2854   present in the message, since a connection-specific header field
2855   might not be needed if there are no parameters associated with a
2856   connection option. In contrast, a connection-specific header field that
2857   is received without a corresponding connection option usually indicates
2858   that the field has been improperly forwarded by an intermediary and
2859   ought to be ignored by the recipient.
2862   When defining new connection options, specification authors ought to survey
2863   existing header field names and ensure that the new connection option does
2864   not share the same name as an already deployed header field.
2865   Defining a new connection option essentially reserves that potential
2866   field-name for carrying additional information related to the
2867   connection option, since it would be unwise for senders to use
2868   that field-name for anything else.
2871   The "close" connection option is defined for a
2872   sender to signal that this connection will be closed after completion of
2873   the response. For example,
2875<figure><artwork type="example"><![CDATA[
2876  Connection: close
2879   in either the request or the response header fields indicates that the
2880   sender is going to close the connection after the current request/response
2881   is complete (<xref target="persistent.tear-down"/>).
2884   A client that does not support <xref target="persistent.connections" format="none">persistent connections</xref> MUST
2885   send the "close" connection option in every request message.
2888   A server that does not support <xref target="persistent.connections" format="none">persistent connections</xref> MUST
2889   send the "close" connection option in every response message that
2890   does not have a 1xx (Informational) status code.
2894<section title="Establishment" anchor="persistent.establishment">
2896   It is beyond the scope of this specification to describe how connections
2897   are established via various transport- or session-layer protocols.
2898   Each connection applies to only one transport link.
2902<section title="Persistence" anchor="persistent.connections">
2905   HTTP/1.1 defaults to the use of "persistent connections",
2906   allowing multiple requests and responses to be carried over a single
2907   connection. The "<xref target="header.connection" format="none">close</xref>" connection option is used to signal
2908   that a connection will not persist after the current request/response.
2909   HTTP implementations SHOULD support persistent connections.
2912   A recipient determines whether a connection is persistent or not based on
2913   the most recently received message's protocol version and
2914   <xref target="header.connection" format="none">Connection</xref> header field (if any):
2915   <list style="symbols">
2916     <t>If the "<xref target="header.connection" format="none">close</xref>" connection option is present, the
2917        connection will not persist after the current response; else,</t>
2918     <t>If the received protocol is HTTP/1.1 (or later), the connection will
2919        persist after the current response; else,</t>
2920     <t>If the received protocol is HTTP/1.0, the "keep-alive"
2921        connection option is present, the recipient is not a proxy, and
2922        the recipient wishes to honor the HTTP/1.0 "keep-alive" mechanism,
2923        the connection will persist after the current response; otherwise,</t>
2924     <t>The connection will close after the current response.</t>
2925   </list>
2928   A client MAY send additional requests on a persistent connection until it
2929   sends or receives a "<xref target="header.connection" format="none">close</xref>" connection option or receives an
2930   HTTP/1.0 response without a "keep-alive" connection option.
2933   In order to remain persistent, all messages on a connection need to
2934   have a self-defined message length (i.e., one not defined by closure
2935   of the connection), as described in <xref target="message.body"/>.
2936   A server MUST read the entire request message body or close
2937   the connection after sending its response, since otherwise the
2938   remaining data on a persistent connection would be misinterpreted
2939   as the next request.  Likewise,
2940   a client MUST read the entire response message body if it intends
2941   to reuse the same connection for a subsequent request.
2944   A proxy server MUST NOT maintain a persistent connection with an
2945   HTTP/1.0 client (see Section 19.7.1 of <xref target="RFC2068"/> for
2946   information and discussion of the problems with the Keep-Alive header field
2947   implemented by many HTTP/1.0 clients).
2950   See <xref target="compatibility.with.http.1.0.persistent.connections"/>
2951   for more information on backwards compatibility with HTTP/1.0 clients.
2954<section title="Retrying Requests" anchor="persistent.retrying.requests">
2956   Connections can be closed at any time, with or without intention.
2957   Implementations ought to anticipate the need to recover
2958   from asynchronous close events.
2961   When an inbound connection is closed prematurely, a client MAY open a new
2962   connection and automatically retransmit an aborted sequence of requests if
2963   all of those requests have idempotent methods (Section 4.2.2 of <xref target="RFC7231"/>).
2964   A proxy MUST NOT automatically retry non-idempotent requests.
2967   A user agent MUST NOT automatically retry a request with a non-idempotent
2968   method unless it has some means to know that the request semantics are
2969   actually idempotent, regardless of the method, or some means to detect that
2970   the original request was never applied. For example, a user agent that
2971   knows (through design or configuration) that a POST request to a given
2972   resource is safe can repeat that request automatically.
2973   Likewise, a user agent designed specifically to operate on a version
2974   control repository might be able to recover from partial failure conditions
2975   by checking the target resource revision(s) after a failed connection,
2976   reverting or fixing any changes that were partially applied, and then
2977   automatically retrying the requests that failed.
2980   A client SHOULD NOT automatically retry a failed automatic retry.
2984<section title="Pipelining" anchor="pipelining">
2987   A client that supports persistent connections MAY "pipeline"
2988   its requests (i.e., send multiple requests without waiting for each
2989   response). A server MAY process a sequence of pipelined requests in
2990   parallel if they all have safe methods (Section 4.2.1 of <xref target="RFC7231"/>), but it MUST send
2991   the corresponding responses in the same order that the requests were
2992   received.
2995   A client that pipelines requests SHOULD retry unanswered requests if the
2996   connection closes before it receives all of the corresponding responses.
2997   When retrying pipelined requests after a failed connection (a connection
2998   not explicitly closed by the server in its last complete response), a
2999   client MUST NOT pipeline immediately after connection establishment,
3000   since the first remaining request in the prior pipeline might have caused
3001   an error response that can be lost again if multiple requests are sent on a
3002   prematurely closed connection (see the TCP reset problem described in
3003   <xref target="persistent.tear-down"/>).
3006   Idempotent methods (Section 4.2.2 of <xref target="RFC7231"/>) are significant to pipelining
3007   because they can be automatically retried after a connection failure.
3008   A user agent SHOULD NOT pipeline requests after a non-idempotent method,
3009   until the final response status code for that method has been received,
3010   unless the user agent has a means to detect and recover from partial
3011   failure conditions involving the pipelined sequence.
3014   An intermediary that receives pipelined requests MAY pipeline those
3015   requests when forwarding them inbound, since it can rely on the outbound
3016   user agent(s) to determine what requests can be safely pipelined. If the
3017   inbound connection fails before receiving a response, the pipelining
3018   intermediary MAY attempt to retry a sequence of requests that have yet
3019   to receive a response if the requests all have idempotent methods;
3020   otherwise, the pipelining intermediary SHOULD forward any received
3021   responses and then close the corresponding outbound connection(s) so that
3022   the outbound user agent(s) can recover accordingly.
3027<section title="Concurrency" anchor="persistent.concurrency">
3029   A client ought to limit the number of simultaneous open
3030   connections that it maintains to a given server.
3033   Previous revisions of HTTP gave a specific number of connections as a
3034   ceiling, but this was found to be impractical for many applications. As a
3035   result, this specification does not mandate a particular maximum number of
3036   connections but, instead, encourages clients to be conservative when opening
3037   multiple connections.
3040   Multiple connections are typically used to avoid the "head-of-line
3041   blocking" problem, wherein a request that takes significant server-side
3042   processing and/or has a large payload blocks subsequent requests on the
3043   same connection. However, each connection consumes server resources.
3044   Furthermore, using multiple connections can cause undesirable side effects
3045   in congested networks.
3048   Note that a server might reject traffic that it deems abusive or
3049   characteristic of a denial-of-service attack, such as an excessive number
3050   of open connections from a single client.
3054<section title="Failures and Timeouts" anchor="persistent.failures">
3056   Servers will usually have some timeout value beyond which they will
3057   no longer maintain an inactive connection. Proxy servers might make
3058   this a higher value since it is likely that the client will be making
3059   more connections through the same proxy server. The use of persistent
3060   connections places no requirements on the length (or existence) of
3061   this timeout for either the client or the server.
3064   A client or server that wishes to time out SHOULD issue a graceful close
3065   on the connection. Implementations SHOULD constantly monitor open
3066   connections for a received closure signal and respond to it as appropriate,
3067   since prompt closure of both sides of a connection enables allocated system
3068   resources to be reclaimed.
3071   A client, server, or proxy MAY close the transport connection at any
3072   time. For example, a client might have started to send a new request
3073   at the same time that the server has decided to close the "idle"
3074   connection. From the server's point of view, the connection is being
3075   closed while it was idle, but from the client's point of view, a
3076   request is in progress.
3079   A server SHOULD sustain persistent connections, when possible, and allow
3080   the underlying transport's flow-control mechanisms to resolve temporary overloads, rather
3081   than terminate connections with the expectation that clients will retry.
3082   The latter technique can exacerbate network congestion.
3085   A client sending a message body SHOULD monitor
3086   the network connection for an error response while it is transmitting
3087   the request. If the client sees a response that indicates the server does
3088   not wish to receive the message body and is closing the connection, the
3089   client SHOULD immediately cease transmitting the body and close its side
3090   of the connection.
3094<section title="Tear-down" anchor="persistent.tear-down">
3095  <iref primary="false" item="Connection header field"/>
3096  <iref primary="false" item="close"/>
3098   The <xref target="header.connection" format="none">Connection</xref> header field
3099   (<xref target="header.connection"/>) provides a "<xref target="header.connection" format="none">close</xref>"
3100   connection option that a sender SHOULD send when it wishes to close
3101   the connection after the current request/response pair.
3104   A client that sends a "<xref target="header.connection" format="none">close</xref>" connection option MUST NOT
3105   send further requests on that connection (after the one containing
3106   "close") and MUST close the connection after reading the
3107   final response message corresponding to this request.
3110   A server that receives a "<xref target="header.connection" format="none">close</xref>" connection option MUST
3111   initiate a close of the connection (see below) after it sends the
3112   final response to the request that contained "close".
3113   The server SHOULD send a "close" connection option
3114   in its final response on that connection. The server MUST NOT process
3115   any further requests received on that connection.
3118   A server that sends a "<xref target="header.connection" format="none">close</xref>" connection option MUST
3119   initiate a close of the connection (see below) after it sends the
3120   response containing "close". The server MUST NOT process
3121   any further requests received on that connection.
3124   A client that receives a "<xref target="header.connection" format="none">close</xref>" connection option MUST
3125   cease sending requests on that connection and close the connection
3126   after reading the response message containing the "close"; if additional
3127   pipelined requests had been sent on the connection, the client SHOULD NOT
3128   assume that they will be processed by the server.
3131   If a server performs an immediate close of a TCP connection, there is a
3132   significant risk that the client will not be able to read the last HTTP
3133   response.  If the server receives additional data from the client on a
3134   fully closed connection, such as another request that was sent by the
3135   client before receiving the server's response, the server's TCP stack will
3136   send a reset packet to the client; unfortunately, the reset packet might
3137   erase the client's unacknowledged input buffers before they can be read
3138   and interpreted by the client's HTTP parser.
3141   To avoid the TCP reset problem, servers typically close a connection in
3142   stages. First, the server performs a half-close by closing only the write
3143   side of the read/write connection. The server then continues to read from
3144   the connection until it receives a corresponding close by the client, or
3145   until the server is reasonably certain that its own TCP stack has received
3146   the client's acknowledgement of the packet(s) containing the server's last
3147   response. Finally, the server fully closes the connection.
3150   It is unknown whether the reset problem is exclusive to TCP or might also
3151   be found in other transport connection protocols.
3155<section title="Upgrade" anchor="header.upgrade">
3156  <iref primary="true" item="Upgrade header field"/>
3162   The "Upgrade" header field is intended to provide a simple mechanism
3163   for transitioning from HTTP/1.1 to some other protocol on the same
3164   connection.  A client MAY send a list of protocols in the Upgrade
3165   header field of a request to invite the server to switch to one or
3166   more of those protocols, in order of descending preference, before sending
3167   the final response. A server MAY ignore a received Upgrade header field
3168   if it wishes to continue using the current protocol on that connection.
3169   Upgrade cannot be used to insist on a protocol change.
3171<figure><iref primary="true" item="Grammar" subitem="Upgrade"/><artwork type="abnf2616"><![CDATA[
3172  Upgrade          = 1#protocol
3174  protocol         = protocol-name ["/" protocol-version]
3175  protocol-name    = token
3176  protocol-version = token
3179   A server that sends a 101 (Switching Protocols) response
3180   MUST send an Upgrade header field to indicate the new protocol(s) to
3181   which the connection is being switched; if multiple protocol layers are
3182   being switched, the sender MUST list the protocols in layer-ascending
3183   order. A server MUST NOT switch to a protocol that was not indicated by
3184   the client in the corresponding request's Upgrade header field.
3185   A server MAY choose to ignore the order of preference indicated by the
3186   client and select the new protocol(s) based on other factors, such as the
3187   nature of the request or the current load on the server.
3190   A server that sends a 426 (Upgrade Required) response
3191   MUST send an Upgrade header field to indicate the acceptable protocols,
3192   in order of descending preference.
3195   A server MAY send an Upgrade header field in any other response to
3196   advertise that it implements support for upgrading to the listed protocols,
3197   in order of descending preference, when appropriate for a future request.
3200   The following is a hypothetical example sent by a client:
3201</preamble><artwork type="message/http; msgtype=&#34;request&#34;"><![CDATA[
3202  GET /hello.txt HTTP/1.1
3203  Host:
3204  Connection: upgrade
3205  Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
3207  ]]></artwork></figure>
3209   The capabilities and nature of the
3210   application-level communication after the protocol change is entirely
3211   dependent upon the new protocol(s) chosen. However, immediately after
3212   sending the 101 (Switching Protocols) response, the server is expected to continue responding to
3213   the original request as if it had received its equivalent within the new
3214   protocol (i.e., the server still has an outstanding request to satisfy
3215   after the protocol has been changed, and is expected to do so without
3216   requiring the request to be repeated).
3219   For example, if the Upgrade header field is received in a GET request
3220   and the server decides to switch protocols, it first responds
3221   with a 101 (Switching Protocols) message in HTTP/1.1 and
3222   then immediately follows that with the new protocol's equivalent of a
3223   response to a GET on the target resource.  This allows a connection to be
3224   upgraded to protocols with the same semantics as HTTP without the
3225   latency cost of an additional round trip.  A server MUST NOT switch
3226   protocols unless the received message semantics can be honored by the new
3227   protocol; an OPTIONS request can be honored by any protocol.
3230   The following is an example response to the above hypothetical request:
3231</preamble><artwork type="message/http; msgtype=&#34;response&#34;"><![CDATA[
3232  HTTP/1.1 101 Switching Protocols
3233  Connection: upgrade
3234  Upgrade: HTTP/2.0
3236  [... data stream switches to HTTP/2.0 with an appropriate response
3237  (as defined by new protocol) to the "GET /hello.txt" request ...]
3238  ]]></artwork></figure>
3240   When Upgrade is sent, the sender MUST also send a
3241   <xref target="header.connection" format="none">Connection</xref> header field (<xref target="header.connection"/>)
3242   that contains an "upgrade" connection option, in order to prevent Upgrade
3243   from being accidentally forwarded by intermediaries that might not implement
3244   the listed protocols.  A server MUST ignore an Upgrade header field that
3245   is received in an HTTP/1.0 request.
3248   A client cannot begin using an upgraded protocol on the connection until
3249   it has completely sent the request message (i.e., the client can't change
3250   the protocol it is sending in the middle of a message).
3251   If a server receives both an Upgrade and an Expect header field
3252   with the "100-continue" expectation (Section 5.1.1 of <xref target="RFC7231"/>), the
3253   server MUST send a 100 (Continue) response before sending
3254   a 101 (Switching Protocols) response.
3257   The Upgrade header field only applies to switching protocols on top of the
3258   existing connection; it cannot be used to switch the underlying connection
3259   (transport) protocol, nor to switch the existing communication to a
3260   different connection. For those purposes, it is more appropriate to use a
3261   3xx (Redirection) response (Section 6.4 of <xref target="RFC7231"/>).
3264   This specification only defines the protocol name "HTTP" for use by
3265   the family of Hypertext Transfer Protocols, as defined by the HTTP
3266   version rules of <xref target="http.version"/> and future updates to this
3267   specification. Additional tokens ought to be registered with IANA using the
3268   registration procedure defined in <xref target="upgrade.token.registry"/>.
3273<section title="ABNF List Extension: #rule" anchor="abnf.extension">
3275   A #rule extension to the ABNF rules of <xref target="RFC5234"/> is used to
3276   improve readability in the definitions of some header field values.
3279   A construct "#" is defined, similar to "*", for defining comma-delimited
3280   lists of elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating
3281   at least &lt;n&gt; and at most &lt;m&gt; elements, each separated by a single
3282   comma (",") and optional whitespace (OWS).   
3285   In any production that uses the list construct, a sender MUST NOT
3286   generate empty list elements. In other words, a sender MUST generate
3287   lists that satisfy the following syntax:
3288</preamble><artwork type="example"><![CDATA[
3289  1#element => element *( OWS "," OWS element )
3292   and:
3293</preamble><artwork type="example"><![CDATA[
3294  #element => [ 1#element ]
3297   and for n &gt;= 1 and m &gt; 1:
3298</preamble><artwork type="example"><![CDATA[
3299  <n>#<m>element => element <n-1>*<m-1>( OWS "," OWS element )
3302   For compatibility with legacy list rules, a recipient MUST parse and ignore
3303   a reasonable number of empty list elements: enough to handle common mistakes
3304   by senders that merge values, but not so much that they could be used as a
3305   denial-of-service mechanism. In other words, a recipient MUST accept lists
3306   that satisfy the following syntax:
3308<figure><artwork type="example"><![CDATA[
3309  #element => [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
3311  1#element => *( "," OWS ) element *( OWS "," [ OWS element ] )
3314   Empty elements do not contribute to the count of elements present.
3315   For example, given these ABNF productions:
3317<figure><artwork type="example"><![CDATA[
3318  example-list      = 1#example-list-elmt
3319  example-list-elmt = token ; see Section 3.2.6
3322   Then the following are valid values for example-list (not including the
3323   double quotes, which are present for delimitation only):
3325<figure><artwork type="example"><![CDATA[
3326  "foo,bar"
3327  "foo ,bar,"
3328  "foo , ,bar,charlie   "
3331   In contrast, the following values would be invalid, since at least one
3332   non-empty element is required by the example-list production:
3334<figure><artwork type="example"><![CDATA[
3335  ""
3336  ","
3337  ",   ,"
3340   <xref target="collected.abnf"/> shows the collected ABNF for recipients
3341   after the list constructs have been expanded.
3345<section title="IANA Considerations" anchor="IANA.considerations">
3347<section title="Header Field Registration" anchor="header.field.registration">
3349   HTTP header fields are registered within the "Message Headers" registry
3350   maintained at
3351   &lt;;.
3354   This document defines the following HTTP header fields, so the
3355   "Permanent Message Header Field Names" registry has been updated
3356   accordingly (see <xref target="BCP90"/>).
3359<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
3360<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
3361   <ttcol>Header Field Name</ttcol>
3362   <ttcol>Protocol</ttcol>
3363   <ttcol>Status</ttcol>
3364   <ttcol>Reference</ttcol>
3366   <c>Connection</c>
3367   <c>http</c>
3368   <c>standard</c>
3369   <c>
3370      <xref target="header.connection"/>
3371   </c>
3372   <c>Content-Length</c>
3373   <c>http</c>
3374   <c>standard</c>
3375   <c>
3376      <xref target="header.content-length"/>
3377   </c>
3378   <c>Host</c>
3379   <c>http</c>
3380   <c>standard</c>
3381   <c>
3382      <xref target=""/>
3383   </c>
3384   <c>TE</c>
3385   <c>http</c>
3386   <c>standard</c>
3387   <c>
3388      <xref target="header.te"/>
3389   </c>
3390   <c>Trailer</c>
3391   <c>http</c>
3392   <c>standard</c>
3393   <c>
3394      <xref target="header.trailer"/>
3395   </c>
3396   <c>Transfer-Encoding</c>
3397   <c>http</c>
3398   <c>standard</c>
3399   <c>
3400      <xref target="header.transfer-encoding"/>
3401   </c>
3402   <c>Upgrade</c>
3403   <c>http</c>
3404   <c>standard</c>
3405   <c>
3406      <xref target="header.upgrade"/>
3407   </c>
3408   <c>Via</c>
3409   <c>http</c>
3410   <c>standard</c>
3411   <c>
3412      <xref target="header.via"/>
3413   </c>
3418   Furthermore, the header field-name "Close" has been registered as
3419   "reserved", since using that name as an HTTP header field might
3420   conflict with the "close" connection option of the <xref target="header.connection" format="none">Connection</xref> header field (<xref target="header.connection"/>).
3422<texttable align="left" suppress-title="true">
3423   <ttcol>Header Field Name</ttcol>
3424   <ttcol>Protocol</ttcol>
3425   <ttcol>Status</ttcol>
3426   <ttcol>Reference</ttcol>
3428   <c>Close</c>
3429   <c>http</c>
3430   <c>reserved</c>
3431   <c>
3432      <xref target="header.field.registration"/>
3433   </c>
3436   The change controller is: "IETF ( - Internet Engineering Task Force".
3440<section title="URI Scheme Registration" anchor="uri.scheme.registration">
3442   IANA maintains the registry of URI Schemes <xref target="BCP115"/> at
3443   &lt;;.
3446   This document defines the following URI schemes, so the "Permanent URI
3447   Schemes" registry has been updated accordingly.
3449<texttable align="left" suppress-title="true">
3450   <ttcol>URI Scheme</ttcol>
3451   <ttcol>Description</ttcol>
3452   <ttcol>Reference</ttcol>
3454   <c>http</c>
3455   <c>Hypertext Transfer Protocol</c>
3456   <c><xref target="http.uri"/></c>
3458   <c>https</c>
3459   <c>Hypertext Transfer Protocol Secure</c>
3460   <c><xref target="https.uri"/></c>
3464<section title="Internet Media Type Registration" anchor="">
3466   IANA maintains the registry of Internet media types <xref target="BCP13"/> at
3467   &lt;;.
3470   This document serves as the specification for the Internet media types
3471   "message/http" and "application/http". The following has been registered with
3472   IANA.
3474<section title="Internet Media Type message/http" anchor="">
3475<iref item="Media Type" subitem="message/http" primary="true"/>
3476<iref item="message/http Media Type" primary="true"/>
3478   The message/http type can be used to enclose a single HTTP request or
3479   response message, provided that it obeys the MIME restrictions for all
3480   "message" types regarding line length and encodings.
3483  <list style="hanging">
3484    <t hangText="Type name:">
3485      message
3486    </t>
3487    <t hangText="Subtype name:">
3488      http
3489    </t>
3490    <t hangText="Required parameters:">
3491      N/A
3492    </t>
3493    <t hangText="Optional parameters:">
3494      version, msgtype
3495      <list style="hanging">
3496        <t hangText="version:">
3497          The HTTP-version number of the enclosed message
3498          (e.g., "1.1"). If not present, the version can be
3499          determined from the first line of the body.
3500        </t>
3501        <t hangText="msgtype:">
3502          The message type -- "request" or "response". If not
3503          present, the type can be determined from the first
3504          line of the body.
3505        </t>
3506      </list>
3507    </t>
3508    <t hangText="Encoding considerations:">
3509      only "7bit", "8bit", or "binary" are permitted
3510    </t>
3511    <t hangText="Security considerations:">
3512      see <xref target="security.considerations"/>
3513    </t>
3514    <t hangText="Interoperability considerations:">
3515      N/A
3516    </t>
3517    <t hangText="Published specification:">
3518      This specification (see <xref target=""/>).
3519    </t>
3520    <t hangText="Applications that use this media type:">
3521      N/A
3522    </t>
3523    <t hangText="Fragment identifier considerations:">
3524      N/A
3525    </t>
3526    <t hangText="Additional information:">
3527      <list style="hanging">
3528        <t hangText="Magic number(s):">N/A</t>
3529        <t hangText="Deprecated alias names for this type:">N/A</t>
3530        <t hangText="File extension(s):">N/A</t>
3531        <t hangText="Macintosh file type code(s):">N/A</t>
3532      </list>
3533    </t>
3534    <t hangText="Person and email address to contact for further information:">
3535      See&nbsp;Authors'&nbsp;Addresses&nbsp;section.
3536    </t>
3537    <t hangText="Intended usage:">
3538      COMMON
3539    </t>
3540    <t hangText="Restrictions on usage:">
3541      N/A
3542    </t>
3543    <t hangText="Author:">
3544      See Authors' Addresses section.
3545    </t>
3546    <t hangText="Change controller:">
3547      IESG
3548    </t>
3549  </list>
3552<section title="Internet Media Type application/http" anchor="">
3553<iref item="Media Type" subitem="application/http" primary="true"/>
3554<iref item="application/http Media Type" primary="true"/>
3556   The application/http type can be used to enclose a pipeline of one or more
3557   HTTP request or response messages (not intermixed).
3560  <list style="hanging">
3561    <t hangText="Type name:">
3562      application
3563    </t>
3564    <t hangText="Subtype name:">
3565      http
3566    </t>
3567    <t hangText="Required parameters:">
3568      N/A
3569    </t>
3570    <t hangText="Optional parameters:">
3571      version, msgtype
3572      <list style="hanging">
3573        <t hangText="version:">
3574          The HTTP-version number of the enclosed messages
3575          (e.g., "1.1"). If not present, the version can be
3576          determined from the first line of the body.
3577        </t>
3578        <t hangText="msgtype:">
3579          The message type -- "request" or "response". If not
3580          present, the type can be determined from the first
3581          line of the body.
3582        </t>
3583      </list>
3584    </t>
3585    <t hangText="Encoding considerations:">
3586      HTTP messages enclosed by this type
3587      are in "binary" format; use of an appropriate
3588      Content-Transfer-Encoding is required when
3589      transmitted via email.
3590    </t>
3591    <t hangText="Security considerations:">
3592      see <xref target="security.considerations"/>
3593    </t>
3594    <t hangText="Interoperability considerations:">
3595      N/A
3596    </t>
3597    <t hangText="Published specification:">
3598      This specification (see <xref target=""/>).
3599    </t>
3600    <t hangText="Applications that use this media type:">
3601      N/A
3602    </t>
3603    <t hangText="Fragment identifier considerations:">
3604      N/A
3605    </t>
3606    <t hangText="Additional information:">
3607      <list style="hanging">
3608        <t hangText="Deprecated alias names for this type:">N/A</t>
3609        <t hangText="Magic number(s):">N/A</t>
3610        <t hangText="File extension(s):">N/A</t>
3611        <t hangText="Macintosh file type code(s):">N/A</t>
3612      </list>
3613    </t>
3614    <t hangText="Person and email address to contact for further information:">
3615      See&nbsp;Authors'&nbsp;Addresses&nbsp;section.
3616    </t>
3617    <t hangText="Intended usage:">
3618      COMMON
3619    </t>
3620    <t hangText="Restrictions on usage:">
3621      N/A
3622    </t>
3623    <t hangText="Author:">
3624      See Authors' Addresses section.
3625    </t>
3626    <t hangText="Change controller:">
3627      IESG
3628    </t>
3629  </list>
3634<section title="Transfer Coding Registry" anchor="transfer.coding.registry">
3636   The "HTTP Transfer Coding Registry" defines the namespace for transfer
3637   coding names. It is maintained at &lt;;.
3640<section title="Procedure" anchor="transfer.coding.registry.procedure">
3642   Registrations MUST include the following fields:
3643   <list style="symbols">
3644     <t>Name</t>
3645     <t>Description</t>
3646     <t>Pointer to specification text</t>
3647   </list>
3650   Names of transfer codings MUST NOT overlap with names of content codings
3651   (Section of <xref target="RFC7231"/>) unless the encoding transformation is identical, as
3652   is the case for the compression codings defined in
3653   <xref target="compression.codings"/>.
3656   Values to be added to this namespace require IETF Review (see
3657   Section 4.1 of <xref target="RFC5226"/>), and MUST
3658   conform to the purpose of transfer coding defined in this specification.
3661   Use of program names for the identification of encoding formats
3662   is not desirable and is discouraged for future encodings.
3666<section title="Registration" anchor="transfer.coding.registration">
3668   The "HTTP Transfer Coding Registry" has been updated with the registrations
3669   below:
3671<texttable align="left" suppress-title="true" anchor="iana.transfer.coding.registration.table">
3672   <ttcol>Name</ttcol>
3673   <ttcol>Description</ttcol>
3674   <ttcol>Reference</ttcol>
3675   <c>chunked</c>
3676   <c>Transfer in a series of chunks</c>
3677   <c>
3678      <xref target="chunked.encoding"/>
3679   </c>
3680   <c>compress</c>
3681   <c>UNIX "compress" data format <xref target="Welch"/></c>
3682   <c>
3683      <xref target="compress.coding"/>
3684   </c>
3685   <c>deflate</c>
3686   <c>"deflate" compressed data (<xref target="RFC1951"/>) inside
3687   the "zlib" data format (<xref target="RFC1950"/>)
3688   </c>
3689   <c>
3690      <xref target="deflate.coding"/>
3691   </c>
3692   <c>gzip</c>
3693   <c>GZIP file format <xref target="RFC1952"/></c>
3694   <c>
3695      <xref target="gzip.coding"/>
3696   </c>
3697   <c>x-compress</c>
3698   <c>Deprecated (alias for compress)</c>
3699   <c>
3700      <xref target="compress.coding"/>
3701   </c>
3702   <c>x-gzip</c>
3703   <c>Deprecated (alias for gzip)</c>
3704   <c>
3705      <xref target="gzip.coding"/>
3706   </c>
3711<section title="Content Coding Registration" anchor="content.coding.registration">
3713   IANA maintains the "HTTP Content Coding Registry" at
3714   &lt;;.
3717   The "HTTP Content Coding Registry" has been updated with the registrations
3718   below:
3720<texttable align="left" suppress-title="true" anchor="iana.content.coding.registration.table">
3721   <ttcol>Name</ttcol>
3722   <ttcol>Description</ttcol>
3723   <ttcol>Reference</ttcol>
3724   <c>compress</c>
3725   <c>UNIX "compress" data format <xref target="Welch"/></c>
3726   <c>
3727      <xref target="compress.coding"/>
3728   </c>
3729   <c>deflate</c>
3730   <c>"deflate" compressed data (<xref target="RFC1951"/>) inside
3731   the "zlib" data format (<xref target="RFC1950"/>)</c>
3732   <c>
3733      <xref target="deflate.coding"/>
3734   </c>
3735   <c>gzip</c>
3736   <c>GZIP file format <xref target="RFC1952"/></c>
3737   <c>
3738      <xref target="gzip.coding"/>
3739   </c>
3740   <c>x-compress</c>
3741   <c>Deprecated (alias for compress)</c>
3742   <c>
3743      <xref target="compress.coding"/>
3744   </c>
3745   <c>x-gzip</c>
3746   <c>Deprecated (alias for gzip)</c>
3747   <c>
3748      <xref target="gzip.coding"/>
3749   </c>
3753<section title="Upgrade Token Registry" anchor="upgrade.token.registry">
3755   The "Hypertext Transfer Protocol (HTTP) Upgrade Token Registry" defines the namespace for protocol-name
3756   tokens used to identify protocols in the <xref target="header.upgrade" format="none">Upgrade</xref> header
3757   field. The registry is maintained at &lt;;.
3760<section title="Procedure" anchor="upgrade.token.registry.procedure">  
3762   Each registered protocol name is associated with contact information
3763   and an optional set of specifications that details how the connection
3764   will be processed after it has been upgraded.
3767   Registrations happen on a "First Come First Served" basis (see
3768   Section 4.1 of <xref target="RFC5226"/>) and are subject to the
3769   following rules:
3770  <list style="numbers">
3771    <t>A protocol-name token, once registered, stays registered forever.</t>
3772    <t>The registration MUST name a responsible party for the
3773       registration.</t>
3774    <t>The registration MUST name a point of contact.</t>
3775    <t>The registration MAY name a set of specifications associated with
3776       that token. Such specifications need not be publicly available.</t>
3777    <t>The registration SHOULD name a set of expected "protocol-version"
3778       tokens associated with that token at the time of registration.</t>
3779    <t>The responsible party MAY change the registration at any time.
3780       The IANA will keep a record of all such changes, and make them
3781       available upon request.</t>
3782    <t>The IESG MAY reassign responsibility for a protocol token.
3783       This will normally only be used in the case when a
3784       responsible party cannot be contacted.</t>
3785  </list>
3788   This registration procedure for HTTP Upgrade Tokens replaces that
3789   previously defined in Section 7.2 of <xref target="RFC2817"/>.
3793<section title="Upgrade Token Registration" anchor="upgrade.token.registration">
3795   The "HTTP" entry in the upgrade token registry has been updated with
3796   the registration below:
3798<texttable align="left" suppress-title="true">
3799   <ttcol>Value</ttcol>
3800   <ttcol>Description</ttcol>
3801   <ttcol>Expected Version Tokens</ttcol>
3802   <ttcol>Reference</ttcol>
3804   <c>HTTP</c>
3805   <c>Hypertext Transfer Protocol</c>
3806   <c>any DIGIT.DIGIT (e.g, "2.0")</c>
3807   <c><xref target="http.version"/></c>
3810   The responsible party is: "IETF ( - Internet Engineering Task Force".
3817<section title="Security Considerations" anchor="security.considerations">
3819   This section is meant to inform developers, information providers, and
3820   users of known security considerations relevant to HTTP message syntax,
3821   parsing, and routing. Security considerations about HTTP semantics and
3822   payloads are addressed in <xref target="RFC7231"/>.
3825<section title="Establishing Authority" anchor="establishing.authority">
3826  <iref item="authoritative response" primary="true"/>
3827  <iref item="phishing" primary="true"/>
3829   HTTP relies on the notion of an authoritative response: a
3830   response that has been determined by (or at the direction of) the authority
3831   identified within the target URI to be the most appropriate response for
3832   that request given the state of the target resource at the time of
3833   response message origination. Providing a response from a non-authoritative
3834   source, such as a shared cache, is often useful to improve performance and
3835   availability, but only to the extent that the source can be trusted or
3836   the distrusted response can be safely used.
3839   Unfortunately, establishing authority can be difficult.
3840   For example, phishing is an attack on the user's perception
3841   of authority, where that perception can be misled by presenting similar
3842   branding in hypertext, possibly aided by userinfo obfuscating the authority
3843   component (see <xref target="http.uri"/>).
3844   User agents can reduce the impact of phishing attacks by enabling users to
3845   easily inspect a target URI prior to making an action, by prominently
3846   distinguishing (or rejecting) userinfo when present, and by not sending
3847   stored credentials and cookies when the referring document is from an
3848   unknown or untrusted source.
3851   When a registered name is used in the authority component, the "http" URI
3852   scheme (<xref target="http.uri"/>) relies on the user's local name
3853   resolution service to determine where it can find authoritative responses.
3854   This means that any attack on a user's network host table, cached names, or
3855   name resolution libraries becomes an avenue for attack on establishing
3856   authority. Likewise, the user's choice of server for Domain Name Service
3857   (DNS), and the hierarchy of servers from which it obtains resolution
3858   results, could impact the authenticity of address mappings;
3859   DNS Security Extensions (DNSSEC, <xref target="RFC4033"/>) are one way to
3860   improve authenticity.
3863   Furthermore, after an IP address is obtained, establishing authority for
3864   an "http" URI is vulnerable to attacks on Internet Protocol routing.
3867   The "https" scheme (<xref target="https.uri"/>) is intended to prevent
3868   (or at least reveal) many of these potential attacks on establishing
3869   authority, provided that the negotiated TLS connection is secured and
3870   the client properly verifies that the communicating server's identity
3871   matches the target URI's authority component
3872   (see <xref target="RFC2818"/>). Correctly implementing such verification
3873   can be difficult (see <xref target="Georgiev"/>).
3877<section title="Risks of Intermediaries" anchor="risks.intermediaries">
3879   By their very nature, HTTP intermediaries are men-in-the-middle and, thus,
3880   represent an opportunity for man-in-the-middle attacks. Compromise of
3881   the systems on which the intermediaries run can result in serious security
3882   and privacy problems. Intermediaries might have access to security-related
3883   information, personal information about individual users and
3884   organizations, and proprietary information belonging to users and
3885   content providers. A compromised intermediary, or an intermediary
3886   implemented or configured without regard to security and privacy
3887   considerations, might be used in the commission of a wide range of
3888   potential attacks.
3891   Intermediaries that contain a shared cache are especially vulnerable
3892   to cache poisoning attacks, as described in Section 8 of <xref target="RFC7234"/>.
3895   Implementers need to consider the privacy and security
3896   implications of their design and coding decisions, and of the
3897   configuration options they provide to operators (especially the
3898   default configuration).
3901   Users need to be aware that intermediaries are no more trustworthy than
3902   the people who run them; HTTP itself cannot solve this problem.
3906<section title="Attacks via Protocol Element Length" anchor="attack.protocol.element.length">
3908   Because HTTP uses mostly textual, character-delimited fields, parsers are
3909   often vulnerable to attacks based on sending very long (or very slow)
3910   streams of data, particularly where an implementation is expecting a
3911   protocol element with no predefined length.
3914   To promote interoperability, specific recommendations are made for minimum
3915   size limits on request-line (<xref target="request.line"/>)
3916   and header fields (<xref target="header.fields"/>). These are
3917   minimum recommendations, chosen to be supportable even by implementations
3918   with limited resources; it is expected that most implementations will
3919   choose substantially higher limits.
3922   A server can reject a message that
3923   has a request-target that is too long (Section 6.5.12 of <xref target="RFC7231"/>) or a request payload
3924   that is too large (Section 6.5.11 of <xref target="RFC7231"/>). Additional status codes related to
3925   capacity limits have been defined by extensions to HTTP
3926   <xref target="RFC6585"/>.
3929   Recipients ought to carefully limit the extent to which they process other
3930   protocol elements, including (but not limited to) request methods, response
3931   status phrases, header field-names, numeric values, and body chunks.
3932   Failure to limit such processing can result in buffer overflows, arithmetic
3933   overflows, or increased vulnerability to denial-of-service attacks.
3937<section title="Response Splitting" anchor="response.splitting">
3939   Response splitting (a.k.a, CRLF injection) is a common technique, used in
3940   various attacks on Web usage, that exploits the line-based nature of HTTP
3941   message framing and the ordered association of requests to responses on
3942   persistent connections <xref target="Klein"/>. This technique can be
3943   particularly damaging when the requests pass through a shared cache.
3946   Response splitting exploits a vulnerability in servers (usually within an
3947   application server) where an attacker can send encoded data within some
3948   parameter of the request that is later decoded and echoed within any of the
3949   response header fields of the response. If the decoded data is crafted to
3950   look like the response has ended and a subsequent response has begun, the
3951   response has been split and the content within the apparent second response
3952   is controlled by the attacker. The attacker can then make any other request
3953   on the same persistent connection and trick the recipients (including
3954   intermediaries) into believing that the second half of the split is an
3955   authoritative answer to the second request.
3958   For example, a parameter within the request-target might be read by an
3959   application server and reused within a redirect, resulting in the same
3960   parameter being echoed in the Location header field of the
3961   response. If the parameter is decoded by the application and not properly
3962   encoded when placed in the response field, the attacker can send encoded
3963   CRLF octets and other content that will make the application's single
3964   response look like two or more responses.
3967   A common defense against response splitting is to filter requests for data
3968   that looks like encoded CR and LF (e.g., "%0D" and "%0A"). However, that
3969   assumes the application server is only performing URI decoding, rather
3970   than more obscure data transformations like charset transcoding, XML entity
3971   translation, base64 decoding, sprintf reformatting, etc.  A more effective
3972   mitigation is to prevent anything other than the server's core protocol
3973   libraries from sending a CR or LF within the header section, which means
3974   restricting the output of header fields to APIs that filter for bad octets
3975   and not allowing application servers to write directly to the protocol
3976   stream.
3980<section title="Request Smuggling" anchor="request.smuggling">
3982   Request smuggling (<xref target="Linhart"/>) is a technique that exploits
3983   differences in protocol parsing among various recipients to hide additional
3984   requests (which might otherwise be blocked or disabled by policy) within an
3985   apparently harmless request.  Like response splitting, request smuggling
3986   can lead to a variety of attacks on HTTP usage.
3989   This specification has introduced new requirements on request parsing,
3990   particularly with regard to message framing in
3991   <xref target="message.body.length"/>, to reduce the effectiveness of
3992   request smuggling.
3996<section title="Message Integrity" anchor="message.integrity">
3998   HTTP does not define a specific mechanism for ensuring message integrity,
3999   instead relying on the error-detection ability of underlying transport
4000   protocols and the use of length or chunk-delimited framing to detect
4001   completeness. Additional integrity mechanisms, such as hash functions or
4002   digital signatures applied to the content, can be selectively added to
4003   messages via extensible metadata header fields. Historically, the lack of
4004   a single integrity mechanism has been justified by the informal nature of
4005   most HTTP communication.  However, the prevalence of HTTP as an information
4006   access mechanism has resulted in its increasing use within environments
4007   where verification of message integrity is crucial.
4010   User agents are encouraged to implement configurable means for detecting
4011   and reporting failures of message integrity such that those means can be
4012   enabled within environments for which integrity is necessary. For example,
4013   a browser being used to view medical history or drug interaction
4014   information needs to indicate to the user when such information is detected
4015   by the protocol to be incomplete, expired, or corrupted during transfer.
4016   Such mechanisms might be selectively enabled via user agent extensions or
4017   the presence of message integrity metadata in a response.
4018   At a minimum, user agents ought to provide some indication that allows a
4019   user to distinguish between a complete and incomplete response message
4020   (<xref target="incomplete.messages"/>) when such verification is desired.
4024<section title="Message Confidentiality" anchor="message.confidentiality">
4026   HTTP relies on underlying transport protocols to provide message
4027   confidentiality when that is desired. HTTP has been specifically designed
4028   to be independent of the transport protocol, such that it can be used
4029   over many different forms of encrypted connection, with the selection of
4030   such transports being identified by the choice of URI scheme or within
4031   user agent configuration.
4034   The "https" scheme can be used to identify resources that require a
4035   confidential connection, as described in <xref target="https.uri"/>.
4039<section title="Privacy of Server Log Information" anchor="privacy.of.server.log.information">
4041   A server is in the position to save personal data about a user's requests
4042   over time, which might identify their reading patterns or subjects of
4043   interest.  In particular, log information gathered at an intermediary
4044   often contains a history of user agent interaction, across a multitude
4045   of sites, that can be traced to individual users.
4048   HTTP log information is confidential in nature; its handling is often
4049   constrained by laws and regulations.  Log information needs to be securely
4050   stored and appropriate guidelines followed for its analysis.
4051   Anonymization of personal information within individual entries helps,
4052   but it is generally not sufficient to prevent real log traces from being
4053   re-identified based on correlation with other access characteristics.
4054   As such, access traces that are keyed to a specific client are unsafe to
4055   publish even if the key is pseudonymous.
4058   To minimize the risk of theft or accidental publication, log information
4059   ought to be purged of personally identifiable information, including
4060   user identifiers, IP addresses, and user-provided query parameters,
4061   as soon as that information is no longer necessary to support operational
4062   needs for security, auditing, or fraud control.
4067<section title="Acknowledgments" anchor="acks">
4069   This edition of HTTP/1.1 builds on the many contributions that went into
4070   <xref target="RFC1945" format="none">RFC 1945</xref>,
4071   <xref target="RFC2068" format="none">RFC 2068</xref>,
4072   <xref target="RFC2145" format="none">RFC 2145</xref>, and
4073   <xref target="RFC2616" format="none">RFC 2616</xref>, including
4074   substantial contributions made by the previous authors, editors, and
4075   Working Group Chairs: Tim Berners-Lee, Ari Luotonen, Roy T. Fielding,
4076   Henrik Frystyk Nielsen, Jim Gettys, Jeffrey C. Mogul, Larry Masinter,
4077   and Paul J. Leach. Mark Nottingham oversaw this effort as Working Group Chair.
4080   Since 1999, the following contributors have helped improve the HTTP
4081   specification by reporting bugs, asking smart questions, drafting or
4082   reviewing text, and evaluating open issues:
4085<t>Adam Barth,
4086Adam Roach,
4087Addison Phillips,
4088Adrian Chadd,
4089Adrian Cole,
4090Adrien W. de Croy,
4091Alan Ford,
4092Alan Ruttenberg,
4093Albert Lunde,
4094Alek Storm,
4095Alex Rousskov,
4096Alexandre Morgaut,
4097Alexey Melnikov,
4098Alisha Smith,
4099Amichai Rothman,
4100Amit Klein,
4101Amos Jeffries,
4102Andreas Maier,
4103Andreas Petersson,
4104Andrei Popov,
4105Anil Sharma,
4106Anne van Kesteren,
4107Anthony Bryan,
4108Asbjorn Ulsberg,
4109Ashok Kumar,
4110Balachander Krishnamurthy,
4111Barry Leiba,
4112Ben Laurie,
4113Benjamin Carlyle,
4114Benjamin Niven-Jenkins,
4115Benoit Claise,
4116Bil Corry,
4117Bill Burke,
4118Bjoern Hoehrmann,
4119Bob Scheifler,
4120Boris Zbarsky,
4121Brett Slatkin,
4122Brian Kell,
4123Brian McBarron,
4124Brian Pane,
4125Brian Raymor,
4126Brian Smith,
4127Bruce Perens,
4128Bryce Nesbitt,
4129Cameron Heavon-Jones,
4130Carl Kugler,
4131Carsten Bormann,
4132Charles Fry,
4133Chris Burdess,
4134Chris Newman,
4135Christian Huitema,
4136Cyrus Daboo,
4137Dale Robert Anderson,
4138Dan Wing,
4139Dan Winship,
4140Daniel Stenberg,
4141Darrel Miller,
4142Dave Cridland,
4143Dave Crocker,
4144Dave Kristol,
4145Dave Thaler,
4146David Booth,
4147David Singer,
4148David W. Morris,
4149Diwakar Shetty,
4150Dmitry Kurochkin,
4151Drummond Reed,
4152Duane Wessels,
4153Edward Lee,
4154Eitan Adler,
4155Eliot Lear,
4156Emile Stephan,
4157Eran Hammer-Lahav,
4158Eric D. Williams,
4159Eric J. Bowman,
4160Eric Lawrence,
4161Eric Rescorla,
4162Erik Aronesty,
4163EungJun Yi,
4164Evan Prodromou,
4165Felix Geisendoerfer,
4166Florian Weimer,
4167Frank Ellermann,
4168Fred Akalin,
4169Fred Bohle,
4170Frederic Kayser,
4171Gabor Molnar,
4172Gabriel Montenegro,
4173Geoffrey Sneddon,
4174Gervase Markham,
4175Gili Tzabari,
4176Grahame Grieve,
4177Greg Slepak,
4178Greg Wilkins,
4179Grzegorz Calkowski,
4180Harald Tveit Alvestrand,
4181Harry Halpin,
4182Helge Hess,
4183Henrik Nordstrom,
4184Henry S. Thompson,
4185Henry Story,
4186Herbert van de Sompel,
4187Herve Ruellan,
4188Howard Melman,
4189Hugo Haas,
4190Ian Fette,
4191Ian Hickson,
4192Ido Safruti,
4193Ilari Liusvaara,
4194Ilya Grigorik,
4195Ingo Struck,
4196J. Ross Nicoll,
4197James Cloos,
4198James H. Manger,
4199James Lacey,
4200James M. Snell,
4201Jamie Lokier,
4202Jan Algermissen,
4203Jari Arkko,
4204Jeff Hodges (who came up with the term 'effective Request-URI'),
4205Jeff Pinner,
4206Jeff Walden,
4207Jim Luther,
4208Jitu Padhye,
4209Joe D. Williams,
4210Joe Gregorio,
4211Joe Orton,
4212Joel Jaeggli,
4213John C. Klensin,
4214John C. Mallery,
4215John Cowan,
4216John Kemp,
4217John Panzer,
4218John Schneider,
4219John Stracke,
4220John Sullivan,
4221Jonas Sicking,
4222Jonathan A. Rees,
4223Jonathan Billington,
4224Jonathan Moore,
4225Jonathan Silvera,
4226Jordi Ros,
4227Joris Dobbelsteen,
4228Josh Cohen,
4229Julien Pierre,
4230Jungshik Shin,
4231Justin Chapweske,
4232Justin Erenkrantz,
4233Justin James,
4234Kalvinder Singh,
4235Karl Dubost,
4236Kathleen Moriarty,
4237Keith Hoffman,
4238Keith Moore,
4239Ken Murchison,
4240Koen Holtman,
4241Konstantin Voronkov,
4242Kris Zyp,
4243Leif Hedstrom,
4244Lionel Morand,
4245Lisa Dusseault,
4246Maciej Stachowiak,
4247Manu Sporny,
4248Marc Schneider,
4249Marc Slemko,
4250Mark Baker,
4251Mark Pauley,
4252Mark Watson,
4253Markus Isomaki,
4254Markus Lanthaler,
4255Martin J. Duerst,
4256Martin Musatov,
4257Martin Nilsson,
4258Martin Thomson,
4259Matt Lynch,
4260Matthew Cox,
4261Matthew Kerwin,
4262Max Clark,
4263Menachem Dodge,
4264Meral Shirazipour,
4265Michael Burrows,
4266Michael Hausenblas,
4267Michael Scharf,
4268Michael Sweet,
4269Michael Tuexen,
4270Michael Welzl,
4271Mike Amundsen,
4272Mike Belshe,
4273Mike Bishop,
4274Mike Kelly,
4275Mike Schinkel,
4276Miles Sabin,
4277Murray S. Kucherawy,
4278Mykyta Yevstifeyev,
4279Nathan Rixham,
4280Nicholas Shanks,
4281Nico Williams,
4282Nicolas Alvarez,
4283Nicolas Mailhot,
4284Noah Slater,
4285Osama Mazahir,
4286Pablo Castro,
4287Pat Hayes,
4288Patrick R. McManus,
4289Paul E. Jones,
4290Paul Hoffman,
4291Paul Marquess,
4292Pete Resnick,
4293Peter Lepeska,
4294Peter Occil,
4295Peter Saint-Andre,
4296Peter Watkins,
4297Phil Archer,
4298Phil Hunt,
4299Philippe Mougin,
4300Phillip Hallam-Baker,
4301Piotr Dobrogost,
4302Poul-Henning Kamp,
4303Preethi Natarajan,
4304Rajeev Bector,
4305Ray Polk,
4306Reto Bachmann-Gmuer,
4307Richard Barnes,
4308Richard Cyganiak,
4309Rob Trace,
4310Robby Simpson,
4311Robert Brewer,
4312Robert Collins,
4313Robert Mattson,
4314Robert O'Callahan,
4315Robert Olofsson,
4316Robert Sayre,
4317Robert Siemer,
4318Robert de Wilde,
4319Roberto Javier Godoy,
4320Roberto Peon,
4321Roland Zink,
4322Ronny Widjaja,
4323Ryan Hamilton,
4324S. Mike Dierken,
4325Salvatore Loreto,
4326Sam Johnston,
4327Sam Pullara,
4328Sam Ruby,
4329Saurabh Kulkarni,
4330Scott Lawrence (who maintained the original issues list),
4331Sean B. Palmer,
4332Sean Turner,
4333Sebastien Barnoud,
4334Shane McCarron,
4335Shigeki Ohtsu,
4336Simon Yarde,
4337Stefan Eissing,
4338Stefan Tilkov,
4339Stefanos Harhalakis,
4340Stephane Bortzmeyer,
4341Stephen Farrell,
4342Stephen Kent,
4343Stephen Ludin,
4344Stuart Williams,
4345Subbu Allamaraju,
4346Subramanian Moonesamy,
4347Susan Hares,
4348Sylvain Hellegouarch,
4349Tapan Divekar,
4350Tatsuhiro Tsujikawa,
4351Tatsuya Hayashi,
4352Ted Hardie,
4353Ted Lemon,
4354Thomas Broyer,
4355Thomas Fossati,
4356Thomas Maslen,
4357Thomas Nadeau,
4358Thomas Nordin,
4359Thomas Roessler,
4360Tim Bray,
4361Tim Morgan,
4362Tim Olsen,
4363Tom Zhou,
4364Travis Snoozy,
4365Tyler Close,
4366Vincent Murphy,
4367Wenbo Zhu,
4368Werner Baumann,
4369Wilbur Streett,
4370Wilfredo Sanchez Vega,
4371William A. Rowe Jr.,
4372William Chan,
4373Willy Tarreau,
4374Xiaoshu Wang,
4375Yaron Goland,
4376Yngve Nysaeter Pettersen,
4377Yoav Nir,
4378Yogesh Bang,
4379Yuchung Cheng,
4380Yutaka Oiwa,
4381Yves Lafon (long-time member of the editor team),
4382Zed A. Shaw, and
4383Zhong Yu.
4387   See Section 16 of <xref target="RFC2616"/> for additional
4388   acknowledgements from prior revisions.
4395<references title="Normative References">
4397<!--draft-ietf-httpbis-p2-semantics-26; Companion document, RFC 7231 -->
4398<reference anchor="RFC7231">
4399  <front>
4400    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
4401    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4402      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4403      <address><email></email></address>
4404    </author>
4405    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4406      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4407      <address><email></email></address>
4408    </author>
4409    <date month="May" year="2014"/>
4410  </front>
4411  <seriesInfo name="RFC" value="7231"/>
4413<!-- draft-ietf-httpbis-p4-conditional-26; Companion doc; RFC 7232 -->
4416<reference anchor="RFC7232">
4417  <front>
4418    <title>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>
4419    <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
4420      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4421      <address><email></email></address>
4422    </author>
4423    <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
4424      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4425      <address><email></email></address>
4426    </author>
4427    <date month="May" year="2014"/>
4428  </front>
4429  <seriesInfo name="RFC" value="7232"/>
4433<reference anchor="RFC7233">
4434  <front>
4435    <title>Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>
4436    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4437      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4438      <address><email></email></address>
4439    </author>
4440    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
4441      <organization abbrev="W3C">World Wide Web Consortium</organization>
4442      <address><email></email></address>
4443    </author>
4444    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4445      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4446      <address><email></email></address>
4447    </author>
4448    <date month="May" year="2014"/>
4449  </front>
4450  <seriesInfo name="RFC" value="7233"/>
4454<!--draft-ietf-httpbis-p6-cache-26; Companion doc; RFC 7234 -->
4456<reference anchor="RFC7234">
4457  <front>
4458    <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
4459    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4460      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4461      <address><email></email></address>
4462    </author>
4463    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
4464      <organization>Akamai</organization>
4465      <address><email></email></address>
4466    </author>
4467    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4468      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4469      <address><email></email></address>
4470    </author>
4471    <date month="May" year="2014"/>
4472  </front>
4473  <seriesInfo name="RFC" value="7234"/>
4478<!--draft-ietf-httpbis-p7-auth-26; Companion doc; RFC 7235  -->
4479<reference anchor="RFC7235">
4480  <front>
4481    <title>Hypertext Transfer Protocol (HTTP/1.1): Authentication</title>
4482    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4483      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4484      <address><email></email></address>
4485    </author>
4486    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4487      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4488      <address><email></email></address>
4489    </author>
4490    <date month="May" year="2014"/>
4491  </front>
4492  <seriesInfo name="RFC" value="7235"/>
4496<reference anchor="RFC5234">
4497  <front>
4498    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
4499    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
4500      <organization>Brandenburg InternetWorking</organization>
4501      <address>
4502        <email></email>
4503      </address> 
4504    </author>
4505    <author initials="P." surname="Overell" fullname="Paul Overell">
4506      <organization>THUS plc.</organization>
4507      <address>
4508        <email></email>
4509      </address>
4510    </author>
4511    <date month="January" year="2008"/>
4512  </front>
4513  <seriesInfo name="STD" value="68"/>
4514  <seriesInfo name="RFC" value="5234"/>
4517<reference anchor="RFC2119">
4518  <front>
4519    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
4520    <author initials="S." surname="Bradner" fullname="Scott Bradner">
4521      <organization>Harvard University</organization>
4522      <address><email></email></address>
4523    </author>
4524    <date month="March" year="1997"/>
4525  </front>
4526  <seriesInfo name="BCP" value="14"/>
4527  <seriesInfo name="RFC" value="2119"/>
4530<reference anchor="RFC3986">
4531 <front>
4532  <title abbrev="URI Generic Syntax">Uniform Resource Identifier (URI): Generic Syntax</title>
4533  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4534    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
4535    <address>
4536       <email></email>
4537       <uri></uri>
4538    </address>
4539  </author>
4540  <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
4541    <organization abbrev="Day Software">Day Software</organization>
4542    <address>
4543      <email></email>
4544      <uri></uri>
4545    </address>
4546  </author>
4547  <author initials="L." surname="Masinter" fullname="Larry Masinter">
4548    <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
4549    <address>
4550      <email></email>
4551      <uri></uri>
4552    </address>
4553  </author>
4554  <date month="January" year="2005"/>
4555 </front>
4556 <seriesInfo name="STD" value="66"/>
4557 <seriesInfo name="RFC" value="3986"/>
4560<reference anchor="RFC0793">
4561  <front>
4562    <title>Transmission Control Protocol</title>
4563    <author initials="J." surname="Postel" fullname="Jon Postel">
4564      <organization>University of Southern California (USC)/Information Sciences Institute</organization>
4565    </author>
4566    <date year="1981" month="September"/>
4567  </front>
4568  <seriesInfo name="STD" value="7"/>
4569  <seriesInfo name="RFC" value="793"/>
4572<reference anchor="USASCII">
4573  <front>
4574    <title>Coded Character Set -- 7-bit American Standard Code for Information Interchange</title>
4575    <author>
4576      <organization>American National Standards Institute</organization>
4577    </author>
4578    <date year="1986"/>
4579  </front>
4580  <seriesInfo name="ANSI" value="X3.4"/>
4583<reference anchor="RFC1950">
4584  <front>
4585    <title>ZLIB Compressed Data Format Specification version 3.3</title>
4586    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4587      <organization>Aladdin Enterprises</organization>
4588      <address><email></email></address>
4589    </author>
4590    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly"/>
4591    <date month="May" year="1996"/>
4592  </front>
4593  <seriesInfo name="RFC" value="1950"/>
4597<reference anchor="RFC1951">
4598  <front>
4599    <title>DEFLATE Compressed Data Format Specification version 1.3</title>
4600    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4601      <organization>Aladdin Enterprises</organization>
4602      <address><email></email></address>
4603    </author>
4604    <date month="May" year="1996"/>
4605  </front>
4606  <seriesInfo name="RFC" value="1951"/>
4610<reference anchor="RFC1952">
4611  <front>
4612    <title>GZIP file format specification version 4.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    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
4618      <address><email></email></address>
4619    </author>
4620    <author initials="M." surname="Adler" fullname="Mark Adler">
4621      <address><email></email></address>
4622    </author>
4623    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4624      <address><email></email></address>
4625    </author>
4626    <author initials="G." surname="Randers-Pehrson" fullname="Glenn Randers-Pehrson">
4627      <address><email></email></address>
4628    </author>
4629    <date month="May" year="1996"/>
4630  </front>
4631  <seriesInfo name="RFC" value="1952"/>
4635<reference anchor="Welch">
4636  <front>
4637    <title>A Technique for High-Performance Data Compression</title>
4638    <author initials="T. A." surname="Welch" fullname="Terry A. Welch"/>
4639    <date month="June" year="1984"/>
4640  </front>
4641  <seriesInfo name="IEEE Computer" value="17(6)"/>
4646<references title="Informative References">
4648<reference anchor="ISO-8859-1">
4649  <front>
4650    <title>
4651     Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1
4652    </title>
4653    <author>
4654      <organization>International Organization for Standardization</organization>
4655    </author>
4656    <date year="1998"/>
4657  </front>
4658  <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
4661<reference anchor="RFC1919">
4662  <front>
4663    <title>Classical versus Transparent IP Proxies</title>
4664    <author initials="M." surname="Chatel" fullname="Marc Chatel">
4665      <address><email></email></address>
4666    </author>
4667    <date year="1996" month="March"/>
4668  </front>
4669  <seriesInfo name="RFC" value="1919"/>
4672<reference anchor="RFC1945">
4673  <front>
4674    <title abbrev="HTTP/1.0">Hypertext Transfer Protocol -- HTTP/1.0</title>
4675    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4676      <organization>MIT, Laboratory for Computer Science</organization>
4677      <address><email></email></address>
4678    </author>
4679    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4680      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4681      <address><email></email></address>
4682    </author>
4683    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4684      <organization>W3 Consortium, MIT Laboratory for Computer Science</organization>
4685      <address><email></email></address>
4686    </author>
4687    <date month="May" year="1996"/>
4688  </front>
4689  <seriesInfo name="RFC" value="1945"/>
4692<reference anchor="RFC2045">
4693  <front>
4694    <title abbrev="Internet Message Bodies">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
4695    <author initials="N." surname="Freed" fullname="Ned Freed">
4696      <organization>Innosoft International, Inc.</organization>
4697      <address><email></email></address>
4698    </author>
4699    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
4700      <organization>First Virtual Holdings</organization>
4701      <address><email></email></address>
4702    </author>
4703    <date month="November" year="1996"/>
4704  </front>
4705  <seriesInfo name="RFC" value="2045"/>
4708<reference anchor="RFC2047">
4709  <front>
4710    <title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title>
4711    <author initials="K." surname="Moore" fullname="Keith Moore">
4712      <organization>University of Tennessee</organization>
4713      <address><email></email></address>
4714    </author>
4715    <date month="November" year="1996"/>
4716  </front>
4717  <seriesInfo name="RFC" value="2047"/>
4720<reference anchor="RFC2068">
4721  <front>
4722    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4723    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
4724      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4725      <address><email></email></address>
4726    </author>
4727    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4728      <organization>MIT Laboratory for Computer Science</organization>
4729      <address><email></email></address>
4730    </author>
4731    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
4732      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
4733      <address><email></email></address>
4734    </author>
4735    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4736      <organization>MIT Laboratory for Computer Science</organization>
4737      <address><email></email></address>
4738    </author>
4739    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4740      <organization>MIT Laboratory for Computer Science</organization>
4741      <address><email></email></address>
4742    </author>
4743    <date month="January" year="1997"/>
4744  </front>
4745  <seriesInfo name="RFC" value="2068"/>
4748<reference anchor="RFC2145">
4749  <front>
4750    <title abbrev="HTTP Version Numbers">Use and Interpretation of HTTP Version Numbers</title>
4751    <author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul">
4752      <organization>Western Research Laboratory</organization>
4753      <address><email></email></address>
4754    </author>
4755    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4756      <organization>Department of Information and Computer Science</organization>
4757      <address><email></email></address>
4758    </author>
4759    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4760      <organization>MIT Laboratory for Computer Science</organization>
4761      <address><email></email></address>
4762    </author>
4763    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4764      <organization>W3 Consortium</organization>
4765      <address><email></email></address>
4766    </author>
4767    <date month="May" year="1997"/>
4768  </front>
4769  <seriesInfo name="RFC" value="2145"/>
4772<reference anchor="RFC2616">
4773  <front>
4774    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4775    <author initials="R." surname="Fielding" fullname="R. Fielding">
4776      <organization>University of California, Irvine</organization>
4777      <address><email></email></address>
4778    </author>
4779    <author initials="J." surname="Gettys" fullname="J. Gettys">
4780      <organization>W3C</organization>
4781      <address><email></email></address>
4782    </author>
4783    <author initials="J." surname="Mogul" fullname="J. Mogul">
4784      <organization>Compaq Computer Corporation</organization>
4785      <address><email></email></address>
4786    </author>
4787    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
4788      <organization>MIT Laboratory for Computer Science</organization>
4789      <address><email></email></address>
4790    </author>
4791    <author initials="L." surname="Masinter" fullname="L. Masinter">
4792      <organization>Xerox Corporation</organization>
4793      <address><email></email></address>
4794    </author>
4795    <author initials="P." surname="Leach" fullname="P. Leach">
4796      <organization>Microsoft Corporation</organization>
4797      <address><email></email></address>
4798    </author>
4799    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
4800      <organization>W3C</organization>
4801      <address><email></email></address>
4802    </author>
4803    <date month="June" year="1999"/>
4804  </front>
4805  <seriesInfo name="RFC" value="2616"/>
4808<reference anchor="RFC2817">
4809  <front>
4810    <title>Upgrading to TLS Within HTTP/1.1</title>
4811    <author initials="R." surname="Khare" fullname="R. Khare">
4812      <organization>4K Associates / UC Irvine</organization>
4813      <address><email></email></address>
4814    </author>
4815    <author initials="S." surname="Lawrence" fullname="S. Lawrence">
4816      <organization>Agranat Systems, Inc.</organization>
4817      <address><email></email></address>
4818    </author>
4819    <date year="2000" month="May"/>
4820  </front>
4821  <seriesInfo name="RFC" value="2817"/>
4824<reference anchor="RFC2818">
4825  <front>
4826    <title>HTTP Over TLS</title>
4827    <author initials="E." surname="Rescorla" fullname="Eric Rescorla">
4828      <organization>RTFM, Inc.</organization>
4829      <address><email></email></address>
4830    </author>
4831    <date year="2000" month="May"/>
4832  </front>
4833  <seriesInfo name="RFC" value="2818"/>
4836<reference anchor="RFC3040">
4837  <front>
4838    <title>Internet Web Replication and Caching Taxonomy</title>
4839    <author initials="I." surname="Cooper" fullname="I. Cooper">
4840      <organization>Equinix, Inc.</organization>
4841    </author>
4842    <author initials="I." surname="Melve" fullname="I. Melve">
4843      <organization>UNINETT</organization>
4844    </author>
4845    <author initials="G." surname="Tomlinson" fullname="G. Tomlinson">
4846      <organization>CacheFlow Inc.</organization>
4847    </author>
4848    <date year="2001" month="January"/>
4849  </front>
4850  <seriesInfo name="RFC" value="3040"/>
4853<reference anchor="BCP90">
4854  <front>
4855    <title>Registration Procedures for Message Header Fields</title>
4856    <author initials="G." surname="Klyne" fullname="G. Klyne">
4857      <organization>Nine by Nine</organization>
4858      <address><email></email></address>
4859    </author>
4860    <author initials="M." surname="Nottingham" fullname="M. Nottingham">
4861      <organization>BEA Systems</organization>
4862      <address><email></email></address>
4863    </author>
4864    <author initials="J." surname="Mogul" fullname="J. Mogul">
4865      <organization>HP Labs</organization>
4866      <address><email></email></address>
4867    </author>
4868    <date year="2004" month="September"/>
4869  </front>
4870  <seriesInfo name="BCP" value="90"/>
4871  <seriesInfo name="RFC" value="3864"/>
4874<reference anchor="RFC4033">
4875  <front>
4876    <title>DNS Security Introduction and Requirements</title>
4877    <author initials="R." surname="Arends" fullname="R. Arends"/>
4878    <author initials="R." surname="Austein" fullname="R. Austein"/>
4879    <author initials="M." surname="Larson" fullname="M. Larson"/>
4880    <author initials="D." surname="Massey" fullname="D. Massey"/>
4881    <author initials="S." surname="Rose" fullname="S. Rose"/>
4882    <date year="2005" month="March"/>
4883  </front>
4884  <seriesInfo name="RFC" value="4033"/>
4887<reference anchor="BCP13">
4888  <front>
4889    <title>Media Type Specifications and Registration Procedures</title>
4890    <author initials="N." surname="Freed" fullname="Ned Freed">
4891      <organization>Oracle</organization>
4892      <address>
4893        <email></email>
4894      </address>
4895    </author>
4896    <author initials="J." surname="Klensin" fullname="John C. Klensin">
4897      <address>
4898        <email></email>
4899      </address>
4900    </author>
4901    <author initials="T." surname="Hansen" fullname="Tony Hansen">
4902      <organization>AT&amp;T Laboratories</organization>
4903      <address>
4904        <email></email>
4905      </address>
4906    </author>
4907    <date year="2013" month="January"/>
4908  </front>
4909  <seriesInfo name="BCP" value="13"/>
4910  <seriesInfo name="RFC" value="6838"/>
4913<reference anchor="BCP115">
4914  <front>
4915    <title>Guidelines and Registration Procedures for New URI Schemes</title>
4916    <author initials="T." surname="Hansen" fullname="T. Hansen">
4917      <organization>AT&amp;T Laboratories</organization>
4918      <address>
4919        <email></email>
4920      </address>
4921    </author>
4922    <author initials="T." surname="Hardie" fullname="T. Hardie">
4923      <organization>Qualcomm, Inc.</organization>
4924      <address>
4925        <email></email>
4926      </address>
4927    </author>
4928    <author initials="L." surname="Masinter" fullname="L. Masinter">
4929      <organization>Adobe Systems</organization>
4930      <address>
4931        <email></email>
4932      </address>
4933    </author>
4934    <date year="2006" month="February"/>
4935  </front>
4936  <seriesInfo name="BCP" value="115"/>
4937  <seriesInfo name="RFC" value="4395"/>
4940<reference anchor="RFC4559">
4941  <front>
4942    <title>SPNEGO-based Kerberos and NTLM HTTP Authentication in Microsoft Windows</title>
4943    <author initials="K." surname="Jaganathan" fullname="K. Jaganathan"/>
4944    <author initials="L." surname="Zhu" fullname="L. Zhu"/>
4945    <author initials="J." surname="Brezak" fullname="J. Brezak"/>
4946    <date year="2006" month="June"/>
4947  </front>
4948  <seriesInfo name="RFC" value="4559"/>
4951<reference anchor="RFC5226">
4952  <front>
4953    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
4954    <author initials="T." surname="Narten" fullname="T. Narten">
4955      <organization>IBM</organization>
4956      <address><email></email></address>
4957    </author>
4958    <author initials="H." surname="Alvestrand" fullname="H. Alvestrand">
4959      <organization>Google</organization>
4960      <address><email></email></address>
4961    </author>
4962    <date year="2008" month="May"/>
4963  </front>
4964  <seriesInfo name="BCP" value="26"/>
4965  <seriesInfo name="RFC" value="5226"/>
4968<reference anchor="RFC5246">
4969   <front>
4970      <title>The Transport Layer Security (TLS) Protocol Version 1.2</title>
4971      <author initials="T." surname="Dierks" fullname="T. Dierks"/>
4972      <author initials="E." surname="Rescorla" fullname="E. Rescorla">
4973         <organization>RTFM, Inc.</organization>
4974      </author>
4975      <date year="2008" month="August"/>
4976   </front>
4977   <seriesInfo name="RFC" value="5246"/>
4980<reference anchor="RFC5322">
4981  <front>
4982    <title>Internet Message Format</title>
4983    <author initials="P." surname="Resnick" fullname="P. Resnick">
4984      <organization>Qualcomm Incorporated</organization>
4985    </author>
4986    <date year="2008" month="October"/>
4987  </front>
4988  <seriesInfo name="RFC" value="5322"/>
4991<reference anchor="RFC6265">
4992  <front>
4993    <title>HTTP State Management Mechanism</title>
4994    <author initials="A." surname="Barth" fullname="Adam Barth">
4995      <organization abbrev="U.C. Berkeley">
4996        University of California, Berkeley
4997      </organization>
4998      <address><email></email></address>
4999    </author>
5000    <date year="2011" month="April"/>
5001  </front>
5002  <seriesInfo name="RFC" value="6265"/>
5005<reference anchor="RFC6585">
5006  <front>
5007    <title>Additional HTTP Status Codes</title>
5008    <author initials="M." surname="Nottingham" fullname="M. Nottingham">
5009      <organization>Rackspace</organization>
5010    </author>
5011    <author initials="R." surname="Fielding" fullname="R. Fielding">
5012      <organization>Adobe</organization>
5013    </author>
5014    <date year="2012" month="April"/>
5015   </front>
5016   <seriesInfo name="RFC" value="6585"/>
5020<reference anchor="Kri2001" target="">
5021  <front>
5022    <title>HTTP Cookies: Standards, Privacy, and Politics</title>
5023    <author initials="D." surname="Kristol" fullname="David M. Kristol"/>
5024    <date year="2001" month="November"/>
5025  </front>
5026  <seriesInfo name="ACM Transactions on Internet Technology" value="1(2)"/>
5029<reference anchor="Klein" target="">
5030  <front>
5031    <title>Divide and Conquer - HTTP Response Splitting, Web Cache Poisoning Attacks, and Related Topics</title>
5032    <author initials="A." surname="Klein" fullname="Amit Klein">
5033      <organization>Sanctum, Inc.</organization>
5034    </author>
5035    <date year="2004" month="March"/>
5036  </front>
5039<reference anchor="Georgiev" target="">
5040  <front>
5041    <title>The Most Dangerous Code in the World: Validating SSL Certificates in Non-browser Software</title>
5042    <author initials="M." surname="Georgiev" fullname="Martin Georgiev"/>
5043    <author initials="S." surname="Iyengar" fullname="Subodh Iyengar"/>
5044    <author initials="S." surname="Jana" fullname="Suman Jana"/>
5045    <author initials="R." surname="Anubhai" fullname="Rishita Anubhai"/>
5046    <author initials="D." surname="Boneh" fullname="Dan Boneh"/>
5047    <author initials="V." surname="Shmatikov" fullname="Vitaly Shmatikov"/>
5048    <date year="2012" month="October"/>
5049  </front>
5050  <!--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"/>
5053<reference anchor="Linhart" target="">
5054  <front>
5055    <title>HTTP Request Smuggling</title>
5056    <author initials="C." surname="Linhart" fullname="Chaim Linhart"/>
5057    <author initials="A." surname="Klein" fullname="Amit Klein"/>
5058    <author initials="R." surname="Heled" fullname="Ronen Heled"/>
5059    <author initials="S." surname="Orrin" fullname="Steve Orrin"/>
5060    <date year="2005" month="June"/>
5061  </front>
5067<section title="HTTP Version History" anchor="compatibility">
5069   HTTP has been in use since 1990. The first version, later referred to as
5070   HTTP/0.9, was a simple protocol for hypertext data transfer across the
5071   Internet, using only a single request method (GET) and no metadata.
5072   HTTP/1.0, as defined by <xref target="RFC1945"/>, added a range of request
5073   methods and MIME-like messaging, allowing for metadata to be transferred
5074   and modifiers placed on the request/response semantics. However,
5075   HTTP/1.0 did not sufficiently take into consideration the effects of
5076   hierarchical proxies, caching, the need for persistent connections, or
5077   name-based virtual hosts. The proliferation of incompletely implemented
5078   applications calling themselves "HTTP/1.0" further necessitated a
5079   protocol version change in order for two communicating applications
5080   to determine each other's true capabilities.
5083   HTTP/1.1 remains compatible with HTTP/1.0 by including more stringent
5084   requirements that enable reliable implementations, adding only
5085   those features that can either be safely ignored by an HTTP/1.0
5086   recipient or only be sent when communicating with a party advertising
5087   conformance with HTTP/1.1.
5090   HTTP/1.1 has been designed to make supporting previous versions easy.
5091   A general-purpose HTTP/1.1 server ought to be able to understand any valid
5092   request in the format of HTTP/1.0, responding appropriately with an
5093   HTTP/1.1 message that only uses features understood (or safely ignored) by
5094   HTTP/1.0 clients. Likewise, an HTTP/1.1 client can be expected to
5095   understand any valid HTTP/1.0 response.
5098   Since HTTP/0.9 did not support header fields in a request, there is no
5099   mechanism for it to support name-based virtual hosts (selection of resource
5100   by inspection of the <xref target="" format="none">Host</xref> header field).
5101   Any server that implements name-based virtual hosts ought to disable
5102   support for HTTP/0.9. Most requests that appear to be HTTP/0.9 are, in
5103   fact, badly constructed HTTP/1.x requests caused by a client failing to
5104   properly encode the request-target.
5107<section title="Changes from HTTP/1.0" anchor="changes.from.1.0">
5109   This section summarizes major differences between versions HTTP/1.0
5110   and HTTP/1.1.
5113<section title="Multihomed Web Servers" anchor="">
5115   The requirements that clients and servers support the <xref target="" format="none">Host</xref>
5116   header field (<xref target=""/>), report an error if it is
5117   missing from an HTTP/1.1 request, and accept absolute URIs (<xref target="request-target"/>)
5118   are among the most important changes defined by HTTP/1.1.
5121   Older HTTP/1.0 clients assumed a one-to-one relationship of IP
5122   addresses and servers; there was no other established mechanism for
5123   distinguishing the intended server of a request than the IP address
5124   to which that request was directed. The <xref target="" format="none">Host</xref> header field was
5125   introduced during the development of HTTP/1.1 and, though it was
5126   quickly implemented by most HTTP/1.0 browsers, additional requirements
5127   were placed on all HTTP/1.1 requests in order to ensure complete
5128   adoption.  At the time of this writing, most HTTP-based services
5129   are dependent upon the Host header field for targeting requests.
5133<section title="Keep-Alive Connections" anchor="compatibility.with.http.1.0.persistent.connections">
5135   In HTTP/1.0, each connection is established by the client prior to the
5136   request and closed by the server after sending the response. However, some
5137   implementations implement the explicitly negotiated ("Keep-Alive") version
5138   of persistent connections described in Section 19.7.1 of <xref target="RFC2068"/>.
5141   Some clients and servers might wish to be compatible with these previous
5142   approaches to persistent connections, by explicitly negotiating for them
5143   with a "Connection: keep-alive" request header field. However, some
5144   experimental implementations of HTTP/1.0 persistent connections are faulty;
5145   for example, if an HTTP/1.0 proxy server doesn't understand
5146   <xref target="header.connection" format="none">Connection</xref>, it will erroneously forward that header field
5147   to the next inbound server, which would result in a hung connection.
5150   One attempted solution was the introduction of a Proxy-Connection header
5151   field, targeted specifically at proxies. In practice, this was also
5152   unworkable, because proxies are often deployed in multiple layers, bringing
5153   about the same problem discussed above.
5156   As a result, clients are encouraged not to send the Proxy-Connection header
5157   field in any requests.
5160   Clients are also encouraged to consider the use of Connection: keep-alive
5161   in requests carefully; while they can enable persistent connections with
5162   HTTP/1.0 servers, clients using them will need to monitor the
5163   connection for "hung" requests (which indicate that the client ought stop
5164   sending the header field), and this mechanism ought not be used by clients
5165   at all when a proxy is being used.
5169<section title="Introduction of Transfer-Encoding" anchor="introduction.of.transfer-encoding">
5171   HTTP/1.1 introduces the <xref target="header.transfer-encoding" format="none">Transfer-Encoding</xref> header field
5172   (<xref target="header.transfer-encoding"/>).
5173   Transfer codings need to be decoded prior to forwarding an HTTP message
5174   over a MIME-compliant protocol.
5180<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
5182  HTTP's approach to error handling has been explained.
5183  (<xref target="conformance"/>)
5186  The HTTP-version ABNF production has been clarified to be case-sensitive.
5187  Additionally, version numbers have been restricted to single digits, due
5188  to the fact that implementations are known to handle multi-digit version
5189  numbers incorrectly.
5190  (<xref target="http.version"/>)
5193  Userinfo (i.e., username and password) are now disallowed in HTTP and
5194  HTTPS URIs, because of security issues related to their transmission on the
5195  wire.
5196  (<xref target="http.uri"/>)
5199  The HTTPS URI scheme is now defined by this specification; previously,
5200  it was done in  Section 2.4 of <xref target="RFC2818"/>.
5201  Furthermore, it implies end-to-end security.
5202  (<xref target="https.uri"/>)
5205  HTTP messages can be (and often are) buffered by implementations; despite
5206  it sometimes being available as a stream, HTTP is fundamentally a
5207  message-oriented protocol.
5208  Minimum supported sizes for various protocol elements have been
5209  suggested, to improve interoperability.
5210  (<xref target="http.message"/>)
5213  Invalid whitespace around field-names is now required to be rejected,
5214  because accepting it represents a security vulnerability.
5215  The ABNF productions defining header fields now only list the field value.
5216  (<xref target="header.fields"/>)
5219  Rules about implicit linear whitespace between certain grammar productions
5220  have been removed; now whitespace is only allowed where specifically
5221  defined in the ABNF.
5222  (<xref target="whitespace"/>)
5225  Header fields that span multiple lines ("line folding") are deprecated.
5226  (<xref target="field.parsing"/>)
5229  The NUL octet is no longer allowed in comment and quoted-string text, and
5230  handling of backslash-escaping in them has been clarified.
5231  The quoted-pair rule no longer allows escaping control characters other than
5232  HTAB.
5233  Non-US-ASCII content in header fields and the reason phrase has been obsoleted
5234  and made opaque (the TEXT rule was removed).
5235  (<xref target="field.components"/>)
5238  Bogus <xref target="header.content-length" format="none">Content-Length</xref> header fields are now required to be
5239  handled as errors by recipients.
5240  (<xref target="header.content-length"/>)
5243  The algorithm for determining the message body length has been clarified
5244  to indicate all of the special cases (e.g., driven by methods or status
5245  codes) that affect it, and that new protocol elements cannot define such
5246  special cases.
5247  CONNECT is a new, special case in determining message body length.
5248  "multipart/byteranges" is no longer a way of determining message body length
5249  detection.
5250  (<xref target="message.body.length"/>)
5253  The "identity" transfer coding token has been removed.
5254  (Sections <xref format="counter" target="message.body"/> and
5255  <xref format="counter" target="transfer.codings"/>)
5258  Chunk length does not include the count of the octets in the
5259  chunk header and trailer.
5260  Line folding in chunk extensions is  disallowed.
5261  (<xref target="chunked.encoding"/>)
5264  The meaning of the "deflate" content coding has been clarified.
5265  (<xref target="deflate.coding"/>)
5268  The segment + query components of RFC 3986 have been used to define the
5269  request-target, instead of abs_path from RFC 1808.
5270  The asterisk-form of the request-target is only allowed with the OPTIONS
5271  method.
5272  (<xref target="request-target"/>)
5275  The term "Effective Request URI" has been introduced.
5276  (<xref target="effective.request.uri"/>)
5279  Gateways do not need to generate <xref target="header.via" format="none">Via</xref> header fields anymore.
5280  (<xref target="header.via"/>)
5283  Exactly when "close" connection options have to be sent has been clarified.
5284  Also, "hop-by-hop" header fields are required to appear in the Connection header
5285  field; just because they're defined as hop-by-hop in this specification
5286  doesn't exempt them.
5287  (<xref target="header.connection"/>)
5290  The limit of two connections per server has been removed.
5291  An idempotent sequence of requests is no longer required to be retried.
5292  The requirement to retry requests under certain circumstances when the
5293  server prematurely closes the connection has been removed.
5294  Also, some extraneous requirements about when servers are allowed to close
5295  connections prematurely have been removed.
5296  (<xref target="persistent.connections"/>)
5299  The semantics of the <xref target="header.upgrade" format="none">Upgrade</xref> header field is now defined in
5300  responses other than 101 (this was incorporated from <xref target="RFC2817"/>). Furthermore, the ordering in the field value is now
5301  significant.
5302  (<xref target="header.upgrade"/>)
5305  Empty list elements in list productions (e.g., a list header field containing
5306  ", ,") have been deprecated.
5307  (<xref target="abnf.extension"/>)
5310  Registration of Transfer Codings now requires IETF Review
5311  (<xref target="transfer.coding.registry"/>)
5314  This specification now defines the Upgrade Token Registry, previously
5315  defined in Section 7.2 of <xref target="RFC2817"/>.
5316  (<xref target="upgrade.token.registry"/>)
5319  The expectation to support HTTP/0.9 requests has been removed.
5320  (<xref target="compatibility"/>)
5323  Issues with the Keep-Alive and Proxy-Connection header fields in requests
5324  are pointed out, with use of the latter being discouraged altogether.
5325  (<xref target="compatibility.with.http.1.0.persistent.connections"/>)
5331<section title="Collected ABNF" anchor="collected.abnf">
5333<artwork type="abnf" name="p1-messaging.parsed-abnf"><![CDATA[
5334BWS = OWS
5336Connection = *( "," OWS ) connection-option *( OWS "," [ OWS
5337 connection-option ] )
5338Content-Length = 1*DIGIT
5340HTTP-message = start-line *( header-field CRLF ) CRLF [ message-body
5341 ]
5342HTTP-name = %x48.54.54.50 ; HTTP
5343HTTP-version = HTTP-name "/" DIGIT "." DIGIT
5344Host = uri-host [ ":" port ]
5346OWS = *( SP / HTAB )
5348RWS = 1*( SP / HTAB )
5350TE = [ ( "," / t-codings ) *( OWS "," [ OWS t-codings ] ) ]
5351Trailer = *( "," OWS ) field-name *( OWS "," [ OWS field-name ] )
5352Transfer-Encoding = *( "," OWS ) transfer-coding *( OWS "," [ OWS
5353 transfer-coding ] )
5355URI-reference = <URI-reference, see [RFC3986], Section 4.1>
5356Upgrade = *( "," OWS ) protocol *( OWS "," [ OWS protocol ] )
5358Via = *( "," OWS ) ( received-protocol RWS received-by [ RWS comment
5359 ] ) *( OWS "," [ OWS ( received-protocol RWS received-by [ RWS
5360 comment ] ) ] )
5362absolute-URI = <absolute-URI, see [RFC3986], Section 4.3>
5363absolute-form = absolute-URI
5364absolute-path = 1*( "/" segment )
5365asterisk-form = "*"
5366authority = <authority, see [RFC3986], Section 3.2>
5367authority-form = authority
5369chunk = chunk-size [ chunk-ext ] CRLF chunk-data CRLF
5370chunk-data = 1*OCTET
5371chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
5372chunk-ext-name = token
5373chunk-ext-val = token / quoted-string
5374chunk-size = 1*HEXDIG
5375chunked-body = *chunk last-chunk trailer-part CRLF
5376comment = "(" *( ctext / quoted-pair / comment ) ")"
5377connection-option = token
5378ctext = HTAB / SP / %x21-27 ; '!'-'''
5379 / %x2A-5B ; '*'-'['
5380 / %x5D-7E ; ']'-'~'
5381 / obs-text
5383field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
5384field-name = token
5385field-value = *( field-content / obs-fold )
5386field-vchar = VCHAR / obs-text
5387fragment = <fragment, see [RFC3986], Section 3.5>
5389header-field = field-name ":" OWS field-value OWS
5390http-URI = "http://" authority path-abempty [ "?" query ] [ "#"
5391 fragment ]
5392https-URI = "https://" authority path-abempty [ "?" query ] [ "#"
5393 fragment ]
5395last-chunk = 1*"0" [ chunk-ext ] CRLF
5397message-body = *OCTET
5398method = token
5400obs-fold = CRLF 1*( SP / HTAB )
5401obs-text = %x80-FF
5402origin-form = absolute-path [ "?" query ]
5404partial-URI = relative-part [ "?" query ]
5405path-abempty = <path-abempty, see [RFC3986], Section 3.3>
5406port = <port, see [RFC3986], Section 3.2.3>
5407protocol = protocol-name [ "/" protocol-version ]
5408protocol-name = token
5409protocol-version = token
5410pseudonym = token
5412qdtext = HTAB / SP / "!" / %x23-5B ; '#'-'['
5413 / %x5D-7E ; ']'-'~'
5414 / obs-text
5415query = <query, see [RFC3986], Section 3.4>
5416quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
5417quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
5419rank = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] )
5420reason-phrase = *( HTAB / SP / VCHAR / obs-text )
5421received-by = ( uri-host [ ":" port ] ) / pseudonym
5422received-protocol = [ protocol-name "/" ] protocol-version
5423relative-part = <relative-part, see [RFC3986], Section 4.2>
5424request-line = method SP request-target SP HTTP-version CRLF
5425request-target = origin-form / absolute-form / authority-form /
5426 asterisk-form
5428scheme = <scheme, see [RFC3986], Section 3.1>
5429segment = <segment, see [RFC3986], Section 3.3>
5430start-line = request-line / status-line
5431status-code = 3DIGIT
5432status-line = HTTP-version SP status-code SP reason-phrase CRLF
5434t-codings = "trailers" / ( transfer-coding [ t-ranking ] )
5435t-ranking = OWS ";" OWS "q=" rank
5436tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
5437 "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
5438token = 1*tchar
5439trailer-part = *( header-field CRLF )
5440transfer-coding = "chunked" / "compress" / "deflate" / "gzip" /
5441 transfer-extension
5442transfer-extension = token *( OWS ";" OWS transfer-parameter )
5443transfer-parameter = token BWS "=" BWS ( token / quoted-string )
5445uri-host = <host, see [RFC3986], Section 3.2.2>
Note: See TracBrowser for help on using the repository browser.