source: draft-ietf-httpbis/latest/p1-messaging.xml @ 2673

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

s/multi-homed/multihomed/ (#553)

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 244.6 KB
1<?xml version="1.0" encoding="utf-8"?>
2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns=''>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns=''>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns=''>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns=''>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns=''>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns=''>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns=''>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns=''>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns=''>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns=''>SHOULD NOT</bcp14>">
14  <!ENTITY ID-VERSION "latest">
15  <!ENTITY ID-MONTH "May">
16  <!ENTITY ID-YEAR "2014">
17  <!ENTITY mdash "&#8212;">
18  <!ENTITY nbsp "&#160;">
19  <!ENTITY nbhy  "&#x2011;">
20  <!ENTITY Note "<x:h xmlns:x=''>Note:</x:h>">
21  <!ENTITY caching-overview       "<xref target='RFC7234' x:rel='#caching.overview' xmlns:x=''/>">
22  <!ENTITY cache-incomplete       "<xref target='RFC7234' x:rel='#response.cacheability' xmlns:x=''/>">
23  <!ENTITY cache-poisoning        "<xref target='RFC7234' x:rel='#security.considerations' xmlns:x=''/>">
24  <!ENTITY payload                "<xref target='RFC7231' x:rel='#payload' xmlns:x=''/>">
25  <!ENTITY media-type             "<xref target='RFC7231' x:rel='#media.type' xmlns:x=''/>">
26  <!ENTITY content-codings        "<xref target='RFC7231' x:rel='#content.codings' xmlns:x=''/>">
27  <!ENTITY CONNECT                "<xref target='RFC7231' x:rel='#CONNECT' xmlns:x=''/>">
28  <!ENTITY content.negotiation    "<xref target='RFC7231' x:rel='#content.negotiation' xmlns:x=''/>">
29  <!ENTITY diff-mime              "<xref target='RFC7231' x:rel='#differences.between.http.and.mime' xmlns:x=''/>">
30  <!ENTITY representation         "<xref target='RFC7231' x:rel='#representations' xmlns:x=''/>">
31  <!ENTITY GET                    "<xref target='RFC7231' x:rel='#GET' xmlns:x=''/>">
32  <!ENTITY HEAD                   "<xref target='RFC7231' x:rel='#HEAD' xmlns:x=''/>">
33  <!ENTITY header-allow           "<xref target='RFC7231' x:rel='#header.allow' xmlns:x=''/>">
34  <!ENTITY header-cache-control   "<xref target='RFC7234' x:rel='#header.cache-control' xmlns:x=''/>">
35  <!ENTITY header-content-encoding    "<xref target='RFC7231' x:rel='#header.content-encoding' xmlns:x=''/>">
36  <!ENTITY header-content-location    "<xref target='RFC7231' x:rel='#header.content-location' xmlns:x=''/>">
37  <!ENTITY header-content-range   "<xref target='RFC7233' x:rel='#header.content-range' xmlns:x=''/>">
38  <!ENTITY header-content-type    "<xref target='RFC7231' x:rel='#header.content-type' xmlns:x=''/>">
39  <!ENTITY header-date            "<xref target='RFC7231' x:rel='' xmlns:x=''/>">
40  <!ENTITY header-etag            "<xref target='RFC7232' x:rel='#header.etag' xmlns:x=''/>">
41  <!ENTITY header-expect          "<xref target='RFC7231' x:rel='#header.expect' xmlns:x=''/>">
42  <!ENTITY header-expires         "<xref target='RFC7234' x:rel='#header.expires' xmlns:x=''/>">
43  <!ENTITY header-last-modified   "<xref target='RFC7232' x:rel='#header.last-modified' xmlns:x=''/>">
44  <!ENTITY header-mime-version    "<xref target='RFC7231' x:rel='#mime-version' xmlns:x=''/>">
45  <!ENTITY header-pragma          "<xref target='RFC7234' x:rel='#header.pragma' xmlns:x=''/>">
46  <!ENTITY header-proxy-authenticate  "<xref target='RFC7235' x:rel='#header.proxy-authenticate' xmlns:x=''/>">
47  <!ENTITY header-proxy-authorization "<xref target='RFC7235' x:rel='#header.proxy-authorization' xmlns:x=''/>">
48  <!ENTITY header-server          "<xref target='RFC7231' x:rel='#header.server' xmlns:x=''/>">
49  <!ENTITY header-warning         "<xref target='RFC7234' x:rel='#header.warning' xmlns:x=''/>">
50  <!ENTITY idempotent-methods     "<xref target='RFC7231' x:rel='#idempotent.methods' xmlns:x=''/>">
51  <!ENTITY safe-methods           "<xref target='RFC7231' x:rel='#safe.methods' xmlns:x=''/>">
52  <!ENTITY methods                "<xref target='RFC7231' x:rel='#methods' xmlns:x=''/>">
53  <!ENTITY OPTIONS                "<xref target='RFC7231' x:rel='#OPTIONS' xmlns:x=''/>">
54  <!ENTITY qvalue                 "<xref target='RFC7231' x:rel='#quality.values' xmlns:x=''/>">
55  <!ENTITY request-header-fields  "<xref target='RFC7231' x:rel='#request.header.fields' xmlns:x=''/>">
56  <!ENTITY response-control-data  "<xref target='RFC7231' x:rel='' xmlns:x=''/>">
57  <!ENTITY resource               "<xref target='RFC7231' x:rel='#resources' xmlns:x=''/>">
58  <!ENTITY semantics              "<xref target='RFC7231' xmlns:x=''/>">
59  <!ENTITY status-codes           "<xref target='RFC7231' x:rel='' xmlns:x=''/>">
60  <!ENTITY status-1xx             "<xref target='RFC7231' x:rel='#status.1xx' xmlns:x=''/>">
61  <!ENTITY status-203             "<xref target='RFC7231' x:rel='#status.203' xmlns:x=''/>">
62  <!ENTITY status-3xx             "<xref target='RFC7231' x:rel='#status.3xx' xmlns:x=''/>">
63  <!ENTITY status-304             "<xref target='RFC7232' x:rel='#status.304' xmlns:x=''/>">
64  <!ENTITY status-4xx             "<xref target='RFC7231' x:rel='#status.4xx' xmlns:x=''/>">
65  <!ENTITY status-413             "<xref target='RFC7231' x:rel='#status.413' xmlns:x=''/>">
66  <!ENTITY status-414             "<xref target='RFC7231' x:rel='#status.414' xmlns:x=''/>">
67  <!ENTITY iana-header-registry   "<xref target='RFC7231' x:rel='#header.field.registry' xmlns:x=''/>">
69<?rfc toc="yes" ?>
70<?rfc symrefs="yes" ?>
71<?rfc sortrefs="yes" ?>
72<?rfc compact="yes"?>
73<?rfc subcompact="no" ?>
74<?rfc linkmailto="no" ?>
75<?rfc editing="no" ?>
76<?rfc comments="yes"?>
77<?rfc inline="yes"?>
78<?rfc rfcedstyle="yes"?>
79<?rfc-ext allow-markup-in-artwork="yes" ?>
80<?rfc-ext include-references-in-index="yes" ?>
81<rfc obsoletes="2145, 2616" updates="2817, 2818" category="std" x:maturity-level="proposed"
82     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"
83     xmlns:x=''>
84<x:link rel="next" basename="p2-semantics"/>
85<x:feedback template="{docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
88  <title abbrev="HTTP/1.1 Message Syntax and Routing">Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
90  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
91    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
92    <address>
93      <postal>
94        <street>345 Park Ave</street>
95        <city>San Jose</city>
96        <region>CA</region>
97        <code>95110</code>
98        <country>USA</country>
99      </postal>
100      <email></email>
101      <uri></uri>
102    </address>
103  </author>
105  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
106    <organization abbrev="greenbytes">greenbytes GmbH</organization>
107    <address>
108      <postal>
109        <street>Hafenweg 16</street>
110        <city>Muenster</city><region>NW</region><code>48155</code>
111        <country>Germany</country>
112      </postal>
113      <email></email>
114      <uri></uri>
115    </address>
116  </author>
118  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
120  <area>Applications</area>
121  <workgroup>HTTPbis</workgroup>
123  <keyword>Hypertext Transfer Protocol</keyword>
124  <keyword>HTTP</keyword>
125  <keyword>HTTP message format</keyword>
129   The Hypertext Transfer Protocol (HTTP) is a stateless application-level
130   protocol for distributed, collaborative, hypertext information systems.
131   This document provides an overview of HTTP architecture and its associated
132   terminology, defines the "http" and "https" Uniform Resource Identifier
133   (URI) schemes, defines the HTTP/1.1 message syntax and parsing
134   requirements, and describes related security concerns for implementations.
138<note title="Editorial Note (To be removed by RFC Editor)">
139  <t>
140    Discussion of this draft takes place on the HTTPBIS working group
141    mailing list (, which is archived at
142    <eref target=""/>.
143  </t>
144  <t>
145    The current issues list is at
146    <eref target=""/> and related
147    documents (including fancy diffs) can be found at
148    <eref target=""/>.
149  </t>
150  <t>
151    <spanx>This is a temporary document for the purpose of tracking the editorial changes made during the AUTH48 (RFC publication) phase.</spanx>
152  </t>
156<section title="Introduction" anchor="introduction">
158   The Hypertext Transfer Protocol (HTTP) is a stateless application-level
159   request/response protocol that uses extensible semantics and
160   self-descriptive message payloads for flexible interaction with
161   network-based hypertext information systems. This document is the first in
162   a series of documents that collectively form the HTTP/1.1 specification:
163   <list style="numbers">
164    <t>"Message Syntax and Routing" (this document)</t>
165    <t>"Semantics and Content" <xref target="RFC7231"/></t>
166    <t>"Conditional Requests" <xref target="RFC7232"/></t>
167    <t>"Range Requests" <xref target="RFC7233"/></t>
168    <t>"Caching" <xref target="RFC7234"/></t>
169    <t>"Authentication" <xref target="RFC7235"/></t>
170   </list>
173   This HTTP/1.1 specification obsoletes
174   <xref target="RFC2616" x:fmt="none">RFC 2616</xref> and
175   <xref target="RFC2145" x:fmt="none">RFC 2145</xref> (on HTTP versioning).
176   This specification also updates the use of CONNECT to establish a tunnel,
177   previously defined in <xref target="RFC2817" x:fmt="none">RFC 2817</xref>,
178   and defines the "https" URI scheme that was described informally in
179   <xref target="RFC2818" x:fmt="none">RFC 2818</xref>.
182   HTTP is a generic interface protocol for information systems. It is
183   designed to hide the details of how a service is implemented by presenting
184   a uniform interface to clients that is independent of the types of
185   resources provided. Likewise, servers do not need to be aware of each
186   client's purpose: an HTTP request can be considered in isolation rather
187   than being associated with a specific type of client or a predetermined
188   sequence of application steps. The result is a protocol that can be used
189   effectively in many different contexts and for which implementations can
190   evolve independently over time.
193   HTTP is also designed for use as an intermediation protocol for translating
194   communication to and from non-HTTP information systems.
195   HTTP proxies and gateways can provide access to alternative information
196   services by translating their diverse protocols into a hypertext
197   format that can be viewed and manipulated by clients in the same way
198   as HTTP services.
201   One consequence of this flexibility is that the protocol cannot be
202   defined in terms of what occurs behind the interface. Instead, we
203   are limited to defining the syntax of communication, the intent
204   of received communication, and the expected behavior of recipients.
205   If the communication is considered in isolation, then successful
206   actions ought to be reflected in corresponding changes to the
207   observable interface provided by servers. However, since multiple
208   clients might act in parallel and perhaps at cross-purposes, we
209   cannot require that such changes be observable beyond the scope
210   of a single response.
213   This document describes the architectural elements that are used or
214   referred to in HTTP, defines the "http" and "https" URI schemes,
215   describes overall network operation and connection management,
216   and defines HTTP message framing and forwarding requirements.
217   Our goal is to define all of the mechanisms necessary for HTTP message
218   handling that are independent of message semantics, thereby defining the
219   complete set of requirements for message parsers and
220   message-forwarding intermediaries.
224<section title="Requirements Notation" anchor="intro.requirements">
226   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
227   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
228   document are to be interpreted as described in <xref target="RFC2119"/>.
231   Conformance criteria and considerations regarding error handling
232   are defined in <xref target="conformance"/>.
236<section title="Syntax Notation" anchor="notation">
237<iref primary="true" item="Grammar" subitem="ALPHA"/>
238<iref primary="true" item="Grammar" subitem="CR"/>
239<iref primary="true" item="Grammar" subitem="CRLF"/>
240<iref primary="true" item="Grammar" subitem="CTL"/>
241<iref primary="true" item="Grammar" subitem="DIGIT"/>
242<iref primary="true" item="Grammar" subitem="DQUOTE"/>
243<iref primary="true" item="Grammar" subitem="HEXDIG"/>
244<iref primary="true" item="Grammar" subitem="HTAB"/>
245<iref primary="true" item="Grammar" subitem="LF"/>
246<iref primary="true" item="Grammar" subitem="OCTET"/>
247<iref primary="true" item="Grammar" subitem="SP"/>
248<iref primary="true" item="Grammar" subitem="VCHAR"/>
250   This specification uses the Augmented Backus-Naur Form (ABNF) notation of
251   <xref target="RFC5234"/> with a list extension, defined in
252   <xref target="abnf.extension"/>, that allows for compact definition of
253   comma-separated lists using a '#' operator (similar to how the '*' operator
254   indicates repetition).
255   <xref target="collected.abnf"/> shows the collected grammar with all list
256   operators expanded to standard ABNF notation.
258<t anchor="core.rules">
259  <x:anchor-alias value="ALPHA"/>
260  <x:anchor-alias value="CTL"/>
261  <x:anchor-alias value="CR"/>
262  <x:anchor-alias value="CRLF"/>
263  <x:anchor-alias value="DIGIT"/>
264  <x:anchor-alias value="DQUOTE"/>
265  <x:anchor-alias value="HEXDIG"/>
266  <x:anchor-alias value="HTAB"/>
267  <x:anchor-alias value="LF"/>
268  <x:anchor-alias value="OCTET"/>
269  <x:anchor-alias value="SP"/>
270  <x:anchor-alias value="VCHAR"/>
271   The following core rules are included by
272   reference, as defined in <xref target="RFC5234" x:fmt="," x:sec="B.1"/>:
273   ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
274   DIGIT (decimal 0-9), DQUOTE (double quote),
275   HEXDIG (hexadecimal 0-9/A-F/a-f), HTAB (horizontal tab), LF (line feed),
276   OCTET (any 8-bit sequence of data), SP (space), and
277   VCHAR (any visible <xref target="USASCII"/> character).
280   As a convention, ABNF rule names prefixed with "obs-" denote
281   "obsolete" grammar rules that appear for historical reasons.
286<section title="Architecture" anchor="architecture">
288   HTTP was created for the World Wide Web (WWW) architecture
289   and has evolved over time to support the scalability needs of a worldwide
290   hypertext system. Much of that architecture is reflected in the terminology
291   and syntax productions used to define HTTP.
294<section title="Client/Server Messaging" anchor="operation">
295<iref primary="true" item="client"/>
296<iref primary="true" item="server"/>
297<iref primary="true" item="connection"/>
299   HTTP is a stateless request/response protocol that operates by exchanging
300   <x:dfn>messages</x:dfn> (<xref target="http.message"/>) across a reliable
301   transport- or session-layer
302   "<x:dfn>connection</x:dfn>" (<xref target=""/>).
303   An HTTP "<x:dfn>client</x:dfn>" is a program that establishes a connection
304   to a server for the purpose of sending one or more HTTP requests.
305   An HTTP "<x:dfn>server</x:dfn>" is a program that accepts connections
306   in order to service HTTP requests by sending HTTP responses.
308<iref primary="true" item="user agent"/>
309<iref primary="true" item="origin server"/>
310<iref primary="true" item="browser"/>
311<iref primary="true" item="spider"/>
312<iref primary="true" item="sender"/>
313<iref primary="true" item="recipient"/>
315   The terms "client" and "server" refer only to the roles that
316   these programs perform for a particular connection.  The same program
317   might act as a client on some connections and a server on others.
318   The term "<x:dfn>user agent</x:dfn>" refers to any of the various
319   client programs that initiate a request, including (but not limited to)
320   browsers, spiders (web-based robots), command-line tools, custom
321   applications, and mobile apps.
322   The term "<x:dfn>origin server</x:dfn>" refers to the program that can
323   originate authoritative responses for a given target resource.
324   The terms "<x:dfn>sender</x:dfn>" and "<x:dfn>recipient</x:dfn>" refer to
325   any implementation that sends or receives a given message, respectively.
328   HTTP relies upon the Uniform Resource Identifier (URI)
329   standard <xref target="RFC3986"/> to indicate the target resource
330   (<xref target="target-resource"/>) and relationships between resources.
331   Messages are passed in a format similar to that used by Internet mail
332   <xref target="RFC5322"/> and the Multipurpose Internet Mail Extensions
333   (MIME) <xref target="RFC2045"/> (see &diff-mime; for the differences
334   between HTTP and MIME messages).
337   Most HTTP communication consists of a retrieval request (GET) for
338   a representation of some resource identified by a URI.  In the
339   simplest case, this might be accomplished via a single bidirectional
340   connection (===) between the user agent (UA) and the origin server (O).
342<figure><artwork type="drawing">
343         request   &gt;
344    <x:highlight>UA</x:highlight> ======================================= <x:highlight>O</x:highlight>
345                                &lt;   response
347<iref primary="true" item="message"/>
348<iref primary="true" item="request"/>
349<iref primary="true" item="response"/>
351   A client sends an HTTP request to a server in the form of a <x:dfn>request</x:dfn>
352   message, beginning with a request-line that includes a method, URI, and
353   protocol version (<xref target="request.line"/>),
354   followed by header fields containing
355   request modifiers, client information, and representation metadata
356   (<xref target="header.fields"/>),
357   an empty line to indicate the end of the header section, and finally
358   a message body containing the payload body (if any,
359   <xref target="message.body"/>).
362   A server responds to a client's request by sending one or more HTTP
363   <x:dfn>response</x:dfn>
364   messages, each beginning with a status line that
365   includes the protocol version, a success or error code, and textual
366   reason phrase (<xref target="status.line"/>),
367   possibly followed by header fields containing server
368   information, resource metadata, and representation metadata
369   (<xref target="header.fields"/>),
370   an empty line to indicate the end of the header section, and finally
371   a message body containing the payload body (if any,
372   <xref target="message.body"/>).
375   A connection might be used for multiple request/response exchanges,
376   as defined in <xref target="persistent.connections"/>.
379   The following example illustrates a typical message exchange for a
380   GET request (&GET;) on the URI "":
383Client request:
384</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
385GET /hello.txt HTTP/1.1
386User-Agent: curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
388Accept-Language: en, mi
392Server response:
393</preamble><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
394HTTP/1.1 200 OK
395Date: Mon, 27 Jul 2009 12:28:53 GMT
396Server: Apache
397Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
398ETag: "34aa387-d-1568eb00"
399Accept-Ranges: bytes
400Content-Length: <x:length-of target="exbody"/>
401Vary: Accept-Encoding
402Content-Type: text/plain
404<x:span anchor="exbody">Hello World! My payload includes a trailing CRLF.
409<section title="Implementation Diversity" anchor="implementation-diversity">
411   When considering the design of HTTP, it is easy to fall into a trap of
412   thinking that all user agents are general-purpose browsers and all origin
413   servers are large public websites. That is not the case in practice.
414   Common HTTP user agents include household appliances, stereos, scales,
415   firmware update scripts, command-line programs, mobile apps,
416   and communication devices in a multitude of shapes and sizes.  Likewise,
417   common HTTP origin servers include home automation units, configurable
418   networking components, office machines, autonomous robots, news feeds,
419   traffic cameras, ad selectors, and video-delivery platforms.
422   The term "user agent" does not imply that there is a human user directly
423   interacting with the software agent at the time of a request. In many
424   cases, a user agent is installed or configured to run in the background
425   and save its results for later inspection (or save only a subset of those
426   results that might be interesting or erroneous). Spiders, for example, are
427   typically given a start URI and configured to follow certain behavior while
428   crawling the Web as a hypertext graph.
431   The implementation diversity of HTTP means that not all user agents can
432   make interactive suggestions to their user or provide adequate warning for
433   security or privacy concerns. In the few cases where this
434   specification requires reporting of errors to the user, it is acceptable
435   for such reporting to only be observable in an error console or log file.
436   Likewise, requirements that an automated action be confirmed by the user
437   before proceeding might be met via advance configuration choices,
438   run-time options, or simple avoidance of the unsafe action; confirmation
439   does not imply any specific user interface or interruption of normal
440   processing if the user has already made that choice.
444<section title="Intermediaries" anchor="intermediaries">
445<iref primary="true" item="intermediary"/>
447   HTTP enables the use of intermediaries to satisfy requests through
448   a chain of connections.  There are three common forms of HTTP
449   <x:dfn>intermediary</x:dfn>: proxy, gateway, and tunnel.  In some cases,
450   a single intermediary might act as an origin server, proxy, gateway,
451   or tunnel, switching behavior based on the nature of each request.
453<figure><artwork type="drawing">
454         &gt;             &gt;             &gt;             &gt;
455    <x:highlight>UA</x:highlight> =========== <x:highlight>A</x:highlight> =========== <x:highlight>B</x:highlight> =========== <x:highlight>C</x:highlight> =========== <x:highlight>O</x:highlight>
456               &lt;             &lt;             &lt;             &lt;
459   The figure above shows three intermediaries (A, B, and C) between the
460   user agent and origin server. A request or response message that
461   travels the whole chain will pass through four separate connections.
462   Some HTTP communication options
463   might apply only to the connection with the nearest, non-tunnel
464   neighbor, only to the endpoints of the chain, or to all connections
465   along the chain. Although the diagram is linear, each participant might
466   be engaged in multiple, simultaneous communications. For example, B
467   might be receiving requests from many clients other than A, and/or
468   forwarding requests to servers other than C, at the same time that it
469   is handling A's request. Likewise, later requests might be sent through a
470   different path of connections, often based on dynamic configuration for
471   load balancing.   
474<iref primary="true" item="upstream"/><iref primary="true" item="downstream"/>
475<iref primary="true" item="inbound"/><iref primary="true" item="outbound"/>
476   The terms "<x:dfn>upstream</x:dfn>" and "<x:dfn>downstream</x:dfn>" are
477   used to describe directional requirements in relation to the message flow:
478   all messages flow from upstream to downstream.
479   The terms "inbound" and "outbound" are used to describe directional
480   requirements in relation to the request route:
481   "<x:dfn>inbound</x:dfn>" means toward the origin server and
482   "<x:dfn>outbound</x:dfn>" means toward the user agent.
484<t><iref primary="true" item="proxy"/>
485   A "<x:dfn>proxy</x:dfn>" is a message-forwarding agent that is selected by the
486   client, usually via local configuration rules, to receive requests
487   for some type(s) of absolute URI and attempt to satisfy those
488   requests via translation through the HTTP interface.  Some translations
489   are minimal, such as for proxy requests for "http" URIs, whereas
490   other requests might require translation to and from entirely different
491   application-level protocols. Proxies are often used to group an
492   organization's HTTP requests through a common intermediary for the
493   sake of security, annotation services, or shared caching. Some proxies
494   are designed to apply transformations to selected messages or payloads
495   while they are being forwarded, as described in
496   <xref target="message.transformations"/>.
498<t><iref primary="true" item="gateway"/><iref primary="true" item="reverse proxy"/>
499<iref primary="true" item="accelerator"/>
500   A "<x:dfn>gateway</x:dfn>" (a.k.a. "<x:dfn>reverse proxy</x:dfn>") is an
501   intermediary that acts as an origin server for the outbound connection but
502   translates received requests and forwards them inbound to another server or
503   servers. Gateways are often used to encapsulate legacy or untrusted
504   information services, to improve server performance through
505   "<x:dfn>accelerator</x:dfn>" caching, and to enable partitioning or load
506   balancing of HTTP services across multiple machines.
509   All HTTP requirements applicable to an origin server
510   also apply to the outbound communication of a gateway.
511   A gateway communicates with inbound servers using any protocol that
512   it desires, including private extensions to HTTP that are outside
513   the scope of this specification.  However, an HTTP-to-HTTP gateway
514   that wishes to interoperate with third-party HTTP servers ought to conform
515   to user agent requirements on the gateway's inbound connection.
517<t><iref primary="true" item="tunnel"/>
518   A "<x:dfn>tunnel</x:dfn>" acts as a blind relay between two connections
519   without changing the messages. Once active, a tunnel is not
520   considered a party to the HTTP communication, though the tunnel might
521   have been initiated by an HTTP request. A tunnel ceases to exist when
522   both ends of the relayed connection are closed. Tunnels are used to
523   extend a virtual connection through an intermediary, such as when
524   Transport Layer Security (TLS, <xref target="RFC5246"/>) is used to
525   establish confidential communication through a shared firewall proxy.
528   The above categories for intermediary only consider those acting as
529   participants in the HTTP communication.  There are also intermediaries
530   that can act on lower layers of the network protocol stack, filtering or
531   redirecting HTTP traffic without the knowledge or permission of message
532   senders. Network intermediaries are indistinguishable (at a protocol level)
533   from a man-in-the-middle attack, often introducing security flaws or
534   interoperability problems due to mistakenly violating HTTP semantics.
536<t><iref primary="true" item="interception proxy"/>
537<iref primary="true" item="transparent proxy"/>
538<iref primary="true" item="captive portal"/>
539   For example, an
540   "<x:dfn>interception proxy</x:dfn>" <xref target="RFC3040"/> (also commonly
541   known as a "<x:dfn>transparent proxy</x:dfn>" <xref target="RFC1919"/> or
542   "<x:dfn>captive portal</x:dfn>")
543   differs from an HTTP proxy because it is not selected by the client.
544   Instead, an interception proxy filters or redirects outgoing TCP port 80
545   packets (and occasionally other common port traffic).
546   Interception proxies are commonly found on public network access points,
547   as a means of enforcing account subscription prior to allowing use of
548   non-local Internet services, and within corporate firewalls to enforce
549   network usage policies.
552   HTTP is defined as a stateless protocol, meaning that each request message
553   can be understood in isolation.  Many implementations depend on HTTP's
554   stateless design in order to reuse proxied connections or dynamically
555   load balance requests across multiple servers.  Hence, a server &MUST-NOT;
556   assume that two requests on the same connection are from the same user
557   agent unless the connection is secured and specific to that agent.
558   Some non-standard HTTP extensions (e.g., <xref target="RFC4559"/>) have
559   been known to violate this requirement, resulting in security and
560   interoperability problems.
564<section title="Caches" anchor="caches">
565<iref primary="true" item="cache"/>
567   A "<x:dfn>cache</x:dfn>" is a local store of previous response messages and the
568   subsystem that controls its message storage, retrieval, and deletion.
569   A cache stores cacheable responses in order to reduce the response
570   time and network bandwidth consumption on future, equivalent
571   requests. Any client or server &MAY; employ a cache, though a cache
572   cannot be used by a server while it is acting as a tunnel.
575   The effect of a cache is that the request/response chain is shortened
576   if one of the participants along the chain has a cached response
577   applicable to that request. The following illustrates the resulting
578   chain if B has a cached copy of an earlier response from O (via C)
579   for a request that has not been cached by UA or A.
581<figure><artwork type="drawing">
582            &gt;             &gt;
583       <x:highlight>UA</x:highlight> =========== <x:highlight>A</x:highlight> =========== <x:highlight>B</x:highlight> - - - - - - <x:highlight>C</x:highlight> - - - - - - <x:highlight>O</x:highlight>
584                  &lt;             &lt;
586<t><iref primary="true" item="cacheable"/>
587   A response is "<x:dfn>cacheable</x:dfn>" if a cache is allowed to store a copy of
588   the response message for use in answering subsequent requests.
589   Even when a response is cacheable, there might be additional
590   constraints placed by the client or by the origin server on when
591   that cached response can be used for a particular request. HTTP
592   requirements for cache behavior and cacheable responses are
593   defined in &caching-overview;. 
596   There is a wide variety of architectures and configurations
597   of caches deployed across the World Wide Web and
598   inside large organizations. These include national hierarchies
599   of proxy caches to save transoceanic bandwidth, collaborative systems that
600   broadcast or multicast cache entries, archives of pre-fetched cache
601   entries for use in off-line or high-latency environments, and so on.
605<section title="Conformance and Error Handling" anchor="conformance">
607   This specification targets conformance criteria according to the role of
608   a participant in HTTP communication.  Hence, HTTP requirements are placed
609   on senders, recipients, clients, servers, user agents, intermediaries,
610   origin servers, proxies, gateways, or caches, depending on what behavior
611   is being constrained by the requirement. Additional (social) requirements
612   are placed on implementations, resource owners, and protocol element
613   registrations when they apply beyond the scope of a single communication.
616   The verb "generate" is used instead of "send" where a requirement
617   differentiates between creating a protocol element and merely forwarding a
618   received element downstream.
621   An implementation is considered conformant if it complies with all of the
622   requirements associated with the roles it partakes in HTTP.
625   Conformance includes both the syntax and semantics of protocol
626   elements. A sender &MUST-NOT; generate protocol elements that convey a
627   meaning that is known by that sender to be false. A sender &MUST-NOT;
628   generate protocol elements that do not match the grammar defined by the
629   corresponding ABNF rules. Within a given message, a sender &MUST-NOT;
630   generate protocol elements or syntax alternatives that are only allowed to
631   be generated by participants in other roles (i.e., a role that the sender
632   does not have for that message).
635   When a received protocol element is parsed, the recipient &MUST; be able to
636   parse any value of reasonable length that is applicable to the recipient's
637   role and that matches the grammar defined by the corresponding ABNF rules.
638   Note, however, that some received protocol elements might not be parsed.
639   For example, an intermediary forwarding a message might parse a
640   header-field into generic field-name and field-value components, but then
641   forward the header field without further parsing inside the field-value.
644   HTTP does not have specific length limitations for many of its protocol
645   elements because the lengths that might be appropriate will vary widely,
646   depending on the deployment context and purpose of the implementation.
647   Hence, interoperability between senders and recipients depends on shared
648   expectations regarding what is a reasonable length for each protocol
649   element. Furthermore, what is commonly understood to be a reasonable length
650   for some protocol elements has changed over the course of the past two
651   decades of HTTP use and is expected to continue changing in the future.
654   At a minimum, a recipient &MUST; be able to parse and process protocol
655   element lengths that are at least as long as the values that it generates
656   for those same protocol elements in other messages. For example, an origin
657   server that publishes very long URI references to its own resources needs
658   to be able to parse and process those same references when received as a
659   request target.
662   A recipient &MUST; interpret a received protocol element according to the
663   semantics defined for it by this specification, including extensions to
664   this specification, unless the recipient has determined (through experience
665   or configuration) that the sender incorrectly implements what is implied by
666   those semantics.
667   For example, an origin server might disregard the contents of a received
668   <x:ref>Accept-Encoding</x:ref> header field if inspection of the
669   <x:ref>User-Agent</x:ref> header field indicates a specific implementation
670   version that is known to fail on receipt of certain content codings.
673   Unless noted otherwise, a recipient &MAY; attempt to recover a usable
674   protocol element from an invalid construct.  HTTP does not define
675   specific error handling mechanisms except when they have a direct impact
676   on security, since different applications of the protocol require
677   different error handling strategies.  For example, a Web browser might
678   wish to transparently recover from a response where the
679   <x:ref>Location</x:ref> header field doesn't parse according to the ABNF,
680   whereas a systems control client might consider any form of error recovery
681   to be dangerous.
685<section title="Protocol Versioning" anchor="http.version">
686  <x:anchor-alias value="HTTP-version"/>
687  <x:anchor-alias value="HTTP-name"/>
689   HTTP uses a "&lt;major&gt;.&lt;minor&gt;" numbering scheme to indicate
690   versions of the protocol. This specification defines version "1.1".
691   The protocol version as a whole indicates the sender's conformance
692   with the set of requirements laid out in that version's corresponding
693   specification of HTTP.
696   The version of an HTTP message is indicated by an HTTP-version field
697   in the first line of the message. HTTP-version is case-sensitive.
699<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-version"/><iref primary="true" item="Grammar" subitem="HTTP-name"/>
700  <x:ref>HTTP-version</x:ref>  = <x:ref>HTTP-name</x:ref> "/" <x:ref>DIGIT</x:ref> "." <x:ref>DIGIT</x:ref>
701  <x:ref>HTTP-name</x:ref>     = <x:abnf-char-sequence>"HTTP"</x:abnf-char-sequence> ; "HTTP", case-sensitive
704   The HTTP version number consists of two decimal digits separated by a "."
705   (period or decimal point).  The first digit ("major version") indicates the
706   HTTP messaging syntax, whereas the second digit ("minor version") indicates
707   the highest minor version within that major version to which the sender is
708   conformant and able to understand for future communication.  The minor
709   version advertises the sender's communication capabilities even when the
710   sender is only using a backwards-compatible subset of the protocol,
711   thereby letting the recipient know that more advanced features can
712   be used in response (by servers) or in future requests (by clients).
715   When an HTTP/1.1 message is sent to an HTTP/1.0 recipient
716   <xref target="RFC1945"/> or a recipient whose version is unknown,
717   the HTTP/1.1 message is constructed such that it can be interpreted
718   as a valid HTTP/1.0 message if all of the newer features are ignored.
719   This specification places recipient-version requirements on some
720   new features so that a conformant sender will only use compatible
721   features until it has determined, through configuration or the
722   receipt of a message, that the recipient supports HTTP/1.1.
725   The interpretation of a header field does not change between minor
726   versions of the same major HTTP version, though the default
727   behavior of a recipient in the absence of such a field can change.
728   Unless specified otherwise, header fields defined in HTTP/1.1 are
729   defined for all versions of HTTP/1.x.  In particular, the <x:ref>Host</x:ref>
730   and <x:ref>Connection</x:ref> header fields ought to be implemented by all
731   HTTP/1.x implementations whether or not they advertise conformance with
732   HTTP/1.1.
735   New header fields can be introduced without changing the protocol version
736   if their defined semantics allow them to be safely ignored by recipients
737   that do not recognize them. Header field extensibility is discussed in
738   <xref target="field.extensibility"/>.
741   Intermediaries that process HTTP messages (i.e., all intermediaries
742   other than those acting as tunnels) &MUST; send their own HTTP-version
743   in forwarded messages.  In other words, they are not allowed to blindly
744   forward the first line of an HTTP message without ensuring that the
745   protocol version in that message matches a version to which that
746   intermediary is conformant for both the receiving and
747   sending of messages.  Forwarding an HTTP message without rewriting
748   the HTTP-version might result in communication errors when downstream
749   recipients use the message sender's version to determine what features
750   are safe to use for later communication with that sender.
753   A client &SHOULD; send a request version equal to the highest
754   version to which the client is conformant and
755   whose major version is no higher than the highest version supported
756   by the server, if this is known.  A client &MUST-NOT; send a
757   version to which it is not conformant.
760   A client &MAY; send a lower request version if it is known that
761   the server incorrectly implements the HTTP specification, but only
762   after the client has attempted at least one normal request and determined
763   from the response status code or header fields (e.g., <x:ref>Server</x:ref>) that
764   the server improperly handles higher request versions.
767   A server &SHOULD; send a response version equal to the highest version to
768   which the server is conformant that has a major version less than or equal
769   to the one received in the request.
770   A server &MUST-NOT; send a version to which it is not conformant.
771   A server can send a <x:ref>505 (HTTP Version Not Supported)</x:ref>
772   response if it wishes, for any reason, to refuse service of the client's
773   major protocol version.
776   A server &MAY; send an HTTP/1.0 response to a request
777   if it is known or suspected that the client incorrectly implements the
778   HTTP specification and is incapable of correctly processing later
779   version responses, such as when a client fails to parse the version
780   number correctly or when an intermediary is known to blindly forward
781   the HTTP-version even when it doesn't conform to the given minor
782   version of the protocol. Such protocol downgrades &SHOULD-NOT; be
783   performed unless triggered by specific client attributes, such as when
784   one or more of the request header fields (e.g., <x:ref>User-Agent</x:ref>)
785   uniquely match the values sent by a client known to be in error.
788   The intention of HTTP's versioning design is that the major number
789   will only be incremented if an incompatible message syntax is
790   introduced, and that the minor number will only be incremented when
791   changes made to the protocol have the effect of adding to the message
792   semantics or implying additional capabilities of the sender.  However,
793   the minor version was not incremented for the changes introduced between
794   <xref target="RFC2068"/> and <xref target="RFC2616"/>, and this revision
795   has specifically avoided any such changes to the protocol.
798   When an HTTP message is received with a major version number that the
799   recipient implements, but a higher minor version number than what the
800   recipient implements, the recipient &SHOULD; process the message as if it
801   were in the highest minor version within that major version to which the
802   recipient is conformant. A recipient can assume that a message with a
803   higher minor version, when sent to a recipient that has not yet indicated
804   support for that higher version, is sufficiently backwards-compatible to be
805   safely processed by any implementation of the same major version.
809<section title="Uniform Resource Identifiers" anchor="uri">
810<iref primary="true" item="resource"/>
812   Uniform Resource Identifiers (URIs) <xref target="RFC3986"/> are used
813   throughout HTTP as the means for identifying resources (&resource;).
814   URI references are used to target requests, indicate redirects, and define
815   relationships.
817  <x:anchor-alias value="URI-reference"/>
818  <x:anchor-alias value="absolute-URI"/>
819  <x:anchor-alias value="relative-part"/>
820  <x:anchor-alias value="scheme"/>
821  <x:anchor-alias value="authority"/>
822  <x:anchor-alias value="uri-host"/>
823  <x:anchor-alias value="port"/>
824  <x:anchor-alias value="path"/>
825  <x:anchor-alias value="path-abempty"/>
826  <x:anchor-alias value="segment"/>
827  <x:anchor-alias value="query"/>
828  <x:anchor-alias value="fragment"/>
829  <x:anchor-alias value="absolute-path"/>
830  <x:anchor-alias value="partial-URI"/>
832   The definitions of "URI-reference",
833   "absolute-URI", "relative-part", "scheme", "authority", "port", "host",
834   "path-abempty", "segment", "query", and "fragment" are adopted from the
835   URI generic syntax.
836   An "absolute-path" rule is defined for protocol elements that can contain a
837   non-empty path component. (This rule differs slightly from the path-abempty
838   rule of RFC 3986, which allows for an empty path to be used in references,
839   and path-absolute rule, which does not allow paths that begin with "//".)
840   A "partial-URI" rule is defined for protocol elements
841   that can contain a relative URI but not a fragment component.
843<figure><artwork type="abnf2616"><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>
844  <x:ref>URI-reference</x:ref> = &lt;URI-reference, see <xref target="RFC3986" x:fmt="," x:sec="4.1"/>&gt;
845  <x:ref>absolute-URI</x:ref>  = &lt;absolute-URI, see <xref target="RFC3986" x:fmt="," x:sec="4.3"/>&gt;
846  <x:ref>relative-part</x:ref> = &lt;relative-part, see <xref target="RFC3986" x:fmt="," x:sec="4.2"/>&gt;
847  <x:ref>scheme</x:ref>        = &lt;scheme, see <xref target="RFC3986" x:fmt="," x:sec="3.1"/>&gt;
848  <x:ref>authority</x:ref>     = &lt;authority, see <xref target="RFC3986" x:fmt="," x:sec="3.2"/>&gt;
849  <x:ref>uri-host</x:ref>      = &lt;host, see <xref target="RFC3986" x:fmt="," x:sec="3.2.2"/>&gt;
850  <x:ref>port</x:ref>          = &lt;port, see <xref target="RFC3986" x:fmt="," x:sec="3.2.3"/>&gt;
851  <x:ref>path-abempty</x:ref>  = &lt;path-abempty, see <xref target="RFC3986" x:fmt="," x:sec="3.3"/>&gt;
852  <x:ref>segment</x:ref>       = &lt;segment, see <xref target="RFC3986" x:fmt="," x:sec="3.3"/>&gt;
853  <x:ref>query</x:ref>         = &lt;query, see <xref target="RFC3986" x:fmt="," x:sec="3.4"/>&gt;
854  <x:ref>fragment</x:ref>      = &lt;fragment, see <xref target="RFC3986" x:fmt="," x:sec="3.5"/>&gt;
856  <x:ref>absolute-path</x:ref> = 1*( "/" segment )
857  <x:ref>partial-URI</x:ref>   = relative-part [ "?" query ]
860   Each protocol element in HTTP that allows a URI reference will indicate
861   in its ABNF production whether the element allows any form of reference
862   (URI-reference), only a URI in absolute form (absolute-URI), only the
863   path and optional query components, or some combination of the above.
864   Unless otherwise indicated, URI references are parsed
865   relative to the effective request URI
866   (<xref target="effective.request.uri"/>).
869<section title="http URI Scheme" anchor="http.uri">
870  <x:anchor-alias value="http-URI"/>
871  <iref item="http URI scheme" primary="true"/>
872  <iref item="URI scheme" subitem="http" primary="true"/>
874   The "http" URI scheme is hereby defined for the purpose of minting
875   identifiers according to their association with the hierarchical
876   namespace governed by a potential HTTP origin server listening for
877   TCP (<xref target="RFC0793"/>) connections on a given port.
879<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="http-URI"><!--terminal production--></iref>
880  <x:ref>http-URI</x:ref> = "http:" "//" <x:ref>authority</x:ref> <x:ref>path-abempty</x:ref> [ "?" <x:ref>query</x:ref> ]
881             [ "#" <x:ref>fragment</x:ref> ]
884   The origin server for an "http" URI is identified by the
885   <x:ref>authority</x:ref> component, which includes a host identifier
886   and optional TCP port (<xref target="RFC3986" x:fmt="," x:sec="3.2.2"/>).
887   The hierarchical path component and optional query component serve as an
888   identifier for a potential target resource within that origin server's name
889   space. The optional fragment component allows for indirect identification
890   of a secondary resource, independent of the URI scheme, as defined in
891   <xref target="RFC3986" x:fmt="of" x:sec="3.5"/>.
894   A sender &MUST-NOT; generate an "http" URI with an empty host identifier.
895   A recipient that processes such a URI reference &MUST; reject it as invalid.
898   If the host identifier is provided as an IP address, the origin server is
899   the listener (if any) on the indicated TCP port at that IP address.
900   If host is a registered name, the registered name is an indirect identifier
901   for use with a name resolution service, such as DNS, to find an address for
902   that origin server.
903   If the port subcomponent is empty or not given, TCP port 80 (the
904   reserved port for WWW services) is the default.
907   Note that the presence of a URI with a given authority component does not
908   imply that there is always an HTTP server listening for connections on
909   that host and port. Anyone can mint a URI. What the authority component
910   determines is who has the right to respond authoritatively to requests that
911   target the identified resource. The delegated nature of registered names
912   and IP addresses creates a federated namespace, based on control over the
913   indicated host and port, whether or not an HTTP server is present.
914   See <xref target="establishing.authority"/> for security considerations
915   related to establishing authority.
918   When an "http" URI is used within a context that calls for access to the
919   indicated resource, a client &MAY; attempt access by resolving
920   the host to an IP address, establishing a TCP connection to that address
921   on the indicated port, and sending an HTTP request message
922   (<xref target="http.message"/>) containing the URI's identifying data
923   (<xref target="message.routing"/>) to the server.
924   If the server responds to that request with a non-interim HTTP response
925   message, as described in &status-codes;, then that response
926   is considered an authoritative answer to the client's request.
929   Although HTTP is independent of the transport protocol, the "http"
930   scheme is specific to TCP-based services because the name delegation
931   process depends on TCP for establishing authority.
932   An HTTP service based on some other underlying connection protocol
933   would presumably be identified using a different URI scheme, just as
934   the "https" scheme (below) is used for resources that require an
935   end-to-end secured connection. Other protocols might also be used to
936   provide access to "http" identified resources &mdash; it is only the
937   authoritative interface that is specific to TCP.
940   The URI generic syntax for authority also includes a deprecated
941   userinfo subcomponent (<xref target="RFC3986" x:fmt="," x:sec="3.2.1"/>)
942   for including user authentication information in the URI.  Some
943   implementations make use of the userinfo component for internal
944   configuration of authentication information, such as within command
945   invocation options, configuration files, or bookmark lists, even
946   though such usage might expose a user identifier or password.
947   A sender &MUST-NOT; generate the userinfo subcomponent (and its "@"
948   delimiter) when an "http" URI reference is generated within a message as a
949   request target or header field value.
950   Before making use of an "http" URI reference received from an untrusted
951   source, a recipient &SHOULD; parse for userinfo and treat its presence as
952   an error; it is likely being used to obscure the authority for the sake of
953   phishing attacks.
957<section title="https URI Scheme" anchor="https.uri">
958   <x:anchor-alias value="https-URI"/>
959   <iref item="https URI scheme"/>
960   <iref item="URI scheme" subitem="https"/>
962   The "https" URI scheme is hereby defined for the purpose of minting
963   identifiers according to their association with the hierarchical
964   namespace governed by a potential HTTP origin server listening to a
965   given TCP port for TLS-secured connections (<xref target="RFC5246"/>).
968   All of the requirements listed above for the "http" scheme are also
969   requirements for the "https" scheme, except that TCP port 443 is the
970   default if the port subcomponent is empty or not given,
971   and the user agent &MUST; ensure that its connection to the origin
972   server is secured through the use of strong encryption, end-to-end,
973   prior to sending the first HTTP request.
975<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="https-URI"><!--terminal production--></iref>
976  <x:ref>https-URI</x:ref> = "https:" "//" <x:ref>authority</x:ref> <x:ref>path-abempty</x:ref> [ "?" <x:ref>query</x:ref> ]
977              [ "#" <x:ref>fragment</x:ref> ]
980   Note that the "https" URI scheme depends on both TLS and TCP for
981   establishing authority.
982   Resources made available via the "https" scheme have no shared
983   identity with the "http" scheme even if their resource identifiers
984   indicate the same authority (the same host listening to the same
985   TCP port).  They are distinct namespaces and are considered to be
986   distinct origin servers.  However, an extension to HTTP that is
987   defined to apply to entire host domains, such as the Cookie protocol
988   <xref target="RFC6265"/>, can allow information
989   set by one service to impact communication with other services
990   within a matching group of host domains.
993   The process for authoritative access to an "https" identified
994   resource is defined in <xref target="RFC2818"/>.
998<section title="http and https URI Normalization and Comparison" anchor="uri.comparison">
1000   Since the "http" and "https" schemes conform to the URI generic syntax,
1001   such URIs are normalized and compared according to the algorithm defined
1002   in <xref target="RFC3986" x:fmt="of" x:sec="6"/>, using the defaults
1003   described above for each scheme.
1006   If the port is equal to the default port for a scheme, the normal form is
1007   to omit the port subcomponent. When not being used in absolute form as the
1008   request target of an OPTIONS request, an empty path component is equivalent
1009   to an absolute path of "/", so the normal form is to provide a path of "/"
1010   instead. The scheme and host are case-insensitive and normally provided in
1011   lowercase; all other components are compared in a case-sensitive manner.
1012   Characters other than those in the "reserved" set are equivalent to their
1013   percent-encoded octets: the normal form is to not encode them
1014   (see Sections <xref target="RFC3986" x:fmt="number" x:sec="2.1"/> and
1015   <xref target="RFC3986" x:fmt="number" x:sec="2.2"/> of
1016   <xref target="RFC3986"/>).
1019   For example, the following three URIs are equivalent:
1021<figure><artwork type="example">
1030<section title="Message Format" anchor="http.message">
1031<x:anchor-alias value="generic-message"/>
1032<x:anchor-alias value="message.types"/>
1033<x:anchor-alias value="HTTP-message"/>
1034<x:anchor-alias value="start-line"/>
1035<iref item="header section"/>
1036<iref item="headers"/>
1037<iref item="header field"/>
1039   All HTTP/1.1 messages consist of a start-line followed by a sequence of
1040   octets in a format similar to the Internet Message Format
1041   <xref target="RFC5322"/>: zero or more header fields (collectively
1042   referred to as the "headers" or the "header section"), an empty line
1043   indicating the end of the header section, and an optional message body.
1045<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-message"><!--terminal production--></iref>
1046  <x:ref>HTTP-message</x:ref>   = <x:ref>start-line</x:ref>
1047                   *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> )
1048                   <x:ref>CRLF</x:ref>
1049                   [ <x:ref>message-body</x:ref> ]
1052   The normal procedure for parsing an HTTP message is to read the
1053   start-line into a structure, read each header field into a hash
1054   table by field name until the empty line, and then use the parsed
1055   data to determine if a message body is expected.  If a message body
1056   has been indicated, then it is read as a stream until an amount
1057   of octets equal to the message body length is read or the connection
1058   is closed.
1061   A recipient &MUST; parse an HTTP message as a sequence of octets in an
1062   encoding that is a superset of US-ASCII <xref target="USASCII"/>.
1063   Parsing an HTTP message as a stream of Unicode characters, without regard
1064   for the specific encoding, creates security vulnerabilities due to the
1065   varying ways that string processing libraries handle invalid multibyte
1066   character sequences that contain the octet LF (%x0A).  String-based
1067   parsers can only be safely used within protocol elements after the element
1068   has been extracted from the message, such as within a header field-value
1069   after message parsing has delineated the individual fields.
1072   An HTTP message can be parsed as a stream for incremental processing or
1073   forwarding downstream.  However, recipients cannot rely on incremental
1074   delivery of partial messages, since some implementations will buffer or
1075   delay message forwarding for the sake of network efficiency, security
1076   checks, or payload transformations.
1079   A sender &MUST-NOT; send whitespace between the start-line and
1080   the first header field.
1081   A recipient that receives whitespace between the start-line and
1082   the first header field &MUST; either reject the message as invalid or
1083   consume each whitespace-preceded line without further processing of it
1084   (i.e., ignore the entire line, along with any subsequent lines preceded
1085   by whitespace, until a properly formed header field is received or the
1086   header section is terminated).
1089   The presence of such whitespace in a request
1090   might be an attempt to trick a server into ignoring that field or
1091   processing the line after it as a new request, either of which might
1092   result in a security vulnerability if other implementations within
1093   the request chain interpret the same message differently.
1094   Likewise, the presence of such whitespace in a response might be
1095   ignored by some clients or cause others to cease parsing.
1098<section title="Start Line" anchor="start.line">
1099  <x:anchor-alias value="Start-Line"/>
1101   An HTTP message can be either a request from client to server or a
1102   response from server to client.  Syntactically, the two types of message
1103   differ only in the start-line, which is either a request-line (for requests)
1104   or a status-line (for responses), and in the algorithm for determining
1105   the length of the message body (<xref target="message.body"/>).
1108   In theory, a client could receive requests and a server could receive
1109   responses, distinguishing them by their different start-line formats,
1110   but, in practice, servers are implemented to only expect a request
1111   (a response is interpreted as an unknown or invalid request method)
1112   and clients are implemented to only expect a response.
1114<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="start-line"/>
1115  <x:ref>start-line</x:ref>     = <x:ref>request-line</x:ref> / <x:ref>status-line</x:ref>
1118<section title="Request Line" anchor="request.line">
1119  <x:anchor-alias value="Request"/>
1120  <x:anchor-alias value="request-line"/>
1122   A request-line begins with a method token, followed by a single
1123   space (SP), the request-target, another single space (SP), the
1124   protocol version, and ends with CRLF.
1126<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="request-line"/>
1127  <x:ref>request-line</x:ref>   = <x:ref>method</x:ref> <x:ref>SP</x:ref> <x:ref>request-target</x:ref> <x:ref>SP</x:ref> <x:ref>HTTP-version</x:ref> <x:ref>CRLF</x:ref>
1129<iref primary="true" item="method"/>
1130<t anchor="method">
1131   The method token indicates the request method to be performed on the
1132   target resource. The request method is case-sensitive.
1134<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="method"/>
1135  <x:ref>method</x:ref>         = <x:ref>token</x:ref>
1138   The request methods defined by this specification can be found in
1139   &methods;, along with information regarding the HTTP method registry
1140   and considerations for defining new methods.
1142<iref item="request-target"/>
1144   The request-target identifies the target resource upon which to apply
1145   the request, as defined in <xref target="request-target"/>.
1148   Recipients typically parse the request-line into its component parts by
1149   splitting on whitespace (see <xref target="message.robustness"/>), since
1150   no whitespace is allowed in the three components.
1151   Unfortunately, some user agents fail to properly encode or exclude
1152   whitespace found in hypertext references, resulting in those disallowed
1153   characters being sent in a request-target.
1156   Recipients of an invalid request-line &SHOULD; respond with either a
1157   <x:ref>400 (Bad Request)</x:ref> error or a <x:ref>301 (Moved Permanently)</x:ref>
1158   redirect with the request-target properly encoded.  A recipient &SHOULD-NOT;
1159   attempt to autocorrect and then process the request without a redirect,
1160   since the invalid request-line might be deliberately crafted to bypass
1161   security filters along the request chain.
1164   HTTP does not place a predefined limit on the length of a request-line,
1165   as described in <xref target="conformance"/>.
1166   A server that receives a method longer than any that it implements
1167   &SHOULD; respond with a <x:ref>501 (Not Implemented)</x:ref> status code.
1168   A server that receives a request-target longer than any URI it wishes to
1169   parse &MUST; respond with a
1170   <x:ref>414 (URI Too Long)</x:ref> status code (see &status-414;).
1173   Various ad hoc limitations on request-line length are found in practice.
1174   It is &RECOMMENDED; that all HTTP senders and recipients support, at a
1175   minimum, request-line lengths of 8000 octets.
1179<section title="Status Line" anchor="status.line">
1180  <x:anchor-alias value="response"/>
1181  <x:anchor-alias value="status-line"/>
1182  <x:anchor-alias value="status-code"/>
1183  <x:anchor-alias value="reason-phrase"/>
1185   The first line of a response message is the status-line, consisting
1186   of the protocol version, a space (SP), the status code, another space,
1187   a possibly empty textual phrase describing the status code, and
1188   ending with CRLF.
1190<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="status-line"/>
1191  <x:ref>status-line</x:ref> = <x:ref>HTTP-version</x:ref> <x:ref>SP</x:ref> <x:ref>status-code</x:ref> <x:ref>SP</x:ref> <x:ref>reason-phrase</x:ref> <x:ref>CRLF</x:ref>
1194   The status-code element is a 3-digit integer code describing the
1195   result of the server's attempt to understand and satisfy the client's
1196   corresponding request. The rest of the response message is to be
1197   interpreted in light of the semantics defined for that status code.
1198   See &status-codes; for information about the semantics of status codes,
1199   including the classes of status code (indicated by the first digit),
1200   the status codes defined by this specification, considerations for the
1201   definition of new status codes, and the IANA registry.
1203<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="status-code"/>
1204  <x:ref>status-code</x:ref>    = 3<x:ref>DIGIT</x:ref>
1207   The reason-phrase element exists for the sole purpose of providing a
1208   textual description associated with the numeric status code, mostly
1209   out of deference to earlier Internet application protocols that were more
1210   frequently used with interactive text clients. A client &SHOULD; ignore
1211   the reason-phrase content.
1213<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="reason-phrase"/>
1214  <x:ref>reason-phrase</x:ref>  = *( <x:ref>HTAB</x:ref> / <x:ref>SP</x:ref> / <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref> )
1219<section title="Header Fields" anchor="header.fields">
1220  <x:anchor-alias value="header-field"/>
1221  <x:anchor-alias value="field-content"/>
1222  <x:anchor-alias value="field-name"/>
1223  <x:anchor-alias value="field-value"/>
1224  <x:anchor-alias value="field-vchar"/>
1225  <x:anchor-alias value="obs-fold"/>
1227   Each header field consists of a case-insensitive field name
1228   followed by a colon (":"), optional leading whitespace, the field value,
1229   and optional trailing whitespace.
1231<figure><artwork type="abnf2616"><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"/>
1232  <x:ref>header-field</x:ref>   = <x:ref>field-name</x:ref> ":" <x:ref>OWS</x:ref> <x:ref>field-value</x:ref> <x:ref>OWS</x:ref>
1234  <x:ref>field-name</x:ref>     = <x:ref>token</x:ref>
1235  <x:ref>field-value</x:ref>    = *( <x:ref>field-content</x:ref> / <x:ref>obs-fold</x:ref> )
1236  <x:ref>field-content</x:ref>  = <x:ref>field-vchar</x:ref> [ 1*( <x:ref>SP</x:ref> / <x:ref>HTAB</x:ref> ) <x:ref>field-vchar</x:ref> ]
1237  <x:ref>field-vchar</x:ref>    = <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref>
1239  <x:ref>obs-fold</x:ref>       = <x:ref>CRLF</x:ref> 1*( <x:ref>SP</x:ref> / <x:ref>HTAB</x:ref> )
1240                 ; obsolete line folding
1241                 ; see <xref target="field.parsing"/>
1244   The field-name token labels the corresponding field-value as having the
1245   semantics defined by that header field.  For example, the <x:ref>Date</x:ref>
1246   header field is defined in &header-date; as containing the origination
1247   timestamp for the message in which it appears.
1250<section title="Field Extensibility" anchor="field.extensibility">
1252   Header fields are fully extensible: there is no limit on the
1253   introduction of new field names, each presumably defining new semantics,
1254   nor on the number of header fields used in a given message.  Existing
1255   fields are defined in each part of this specification and in many other
1256   specifications outside this document set.
1259   New header fields can be defined such that, when they are understood by a
1260   recipient, they might override or enhance the interpretation of previously
1261   defined header fields, define preconditions on request evaluation, or
1262   refine the meaning of responses.
1265   A proxy &MUST; forward unrecognized header fields unless the
1266   field-name is listed in the <x:ref>Connection</x:ref> header field
1267   (<xref target="header.connection"/>) or the proxy is specifically
1268   configured to block, or otherwise transform, such fields.
1269   Other recipients &SHOULD; ignore unrecognized header fields.
1270   These requirements allow HTTP's functionality to be enhanced without
1271   requiring prior update of deployed intermediaries.
1274   All defined header fields ought to be registered with IANA in the
1275   "Message Headers" registry, as described in &iana-header-registry;.
1279<section title="Field Order" anchor="field.order">
1281   The order in which header fields with differing field names are
1282   received is not significant. However, it is good practice to send
1283   header fields that contain control data first, such as <x:ref>Host</x:ref>
1284   on requests and <x:ref>Date</x:ref> on responses, so that implementations
1285   can decide when not to handle a message as early as possible.
1286   A server &MUST-NOT; apply a request to the target resource until the entire
1287   request header section is received, since later header fields might include
1288   conditionals, authentication credentials, or deliberately misleading
1289   duplicate header fields that would impact request processing.
1292   A sender &MUST-NOT; generate multiple header fields with the same field
1293   name in a message unless either the entire field value for that
1294   header field is defined as a comma-separated list [i.e., #(values)]
1295   or the header field is a well-known exception (as noted below).
1298   A recipient &MAY; combine multiple header fields with the same field name
1299   into one "field-name: field-value" pair, without changing the semantics of
1300   the message, by appending each subsequent field value to the combined
1301   field value in order, separated by a comma. The order in which
1302   header fields with the same field name are received is therefore
1303   significant to the interpretation of the combined field value;
1304   a proxy &MUST-NOT; change the order of these field values when
1305   forwarding a message.
1308  <t>
1309   &Note; In practice, the "Set-Cookie" header field (<xref target="RFC6265"/>)
1310   often appears multiple times in a response message and does not use the
1311   list syntax, violating the above requirements on multiple header fields
1312   with the same name. Since it cannot be combined into a single field-value,
1313   recipients ought to handle "Set-Cookie" as a special case while processing
1314   header fields. (See Appendix A.2.3 of <xref target="Kri2001"/> for details.)
1315  </t>
1319<section title="Whitespace" anchor="whitespace">
1320<t anchor="rule.LWS">
1321   This specification uses three rules to denote the use of linear
1322   whitespace: OWS (optional whitespace), RWS (required whitespace), and
1323   BWS ("bad" whitespace).
1325<t anchor="rule.OWS">
1326   The OWS rule is used where zero or more linear whitespace octets might
1327   appear. For protocol elements where optional whitespace is preferred to
1328   improve readability, a sender &SHOULD; generate the optional whitespace
1329   as a single SP; otherwise, a sender &SHOULD-NOT; generate optional
1330   whitespace except as needed to white out invalid or unwanted protocol
1331   elements during in-place message filtering.
1333<t anchor="rule.RWS">
1334   The RWS rule is used when at least one linear whitespace octet is required
1335   to separate field tokens. A sender &SHOULD; generate RWS as a single SP.
1337<t anchor="rule.BWS">
1338   The BWS rule is used where the grammar allows optional whitespace only for
1339   historical reasons. A sender &MUST-NOT; generate BWS in messages.
1340   A recipient &MUST; parse for such bad whitespace and remove it before
1341   interpreting the protocol element.
1343<t anchor="rule.whitespace">
1344  <x:anchor-alias value="BWS"/>
1345  <x:anchor-alias value="OWS"/>
1346  <x:anchor-alias value="RWS"/>
1348<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="OWS"/><iref primary="true" item="Grammar" subitem="RWS"/><iref primary="true" item="Grammar" subitem="BWS"/>
1349  <x:ref>OWS</x:ref>            = *( <x:ref>SP</x:ref> / <x:ref>HTAB</x:ref> )
1350                 ; optional whitespace
1351  <x:ref>RWS</x:ref>            = 1*( <x:ref>SP</x:ref> / <x:ref>HTAB</x:ref> )
1352                 ; required whitespace
1353  <x:ref>BWS</x:ref>            = <x:ref>OWS</x:ref>
1354                 ; "bad" whitespace
1358<section title="Field Parsing" anchor="field.parsing">
1360   Messages are parsed using a generic algorithm, independent of the
1361   individual header field names. The contents within a given field value are
1362   not parsed until a later stage of message interpretation (usually after the
1363   message's entire header section has been processed).
1364   Consequently, this specification does not use ABNF rules to define each
1365   "Field-Name: Field Value" pair, as was done in previous editions.
1366   Instead, this specification uses ABNF rules that are named according to
1367   each registered field name, wherein the rule defines the valid grammar for
1368   that field's corresponding field values (i.e., after the field-value
1369   has been extracted from the header section by a generic field parser).
1372   No whitespace is allowed between the header field-name and colon.
1373   In the past, differences in the handling of such whitespace have led to
1374   security vulnerabilities in request routing and response handling.
1375   A server &MUST; reject any received request message that contains
1376   whitespace between a header field-name and colon with a response code of
1377   <x:ref>400 (Bad Request)</x:ref>. A proxy &MUST; remove any such whitespace
1378   from a response message before forwarding the message downstream.
1381   A field value might be preceded and/or followed by optional whitespace
1382   (OWS); a single SP preceding the field-value is preferred for consistent
1383   readability by humans.
1384   The field value does not include any leading or trailing whitespace: OWS
1385   occurring before the first non-whitespace octet of the field value or after
1386   the last non-whitespace octet of the field value ought to be excluded by
1387   parsers when extracting the field value from a header field.
1390   Historically, HTTP header field values could be extended over multiple
1391   lines by preceding each extra line with at least one space or horizontal
1392   tab (obs-fold). This specification deprecates such line folding except
1393   within the message/http media type
1394   (<xref target=""/>).
1395   A sender &MUST-NOT; generate a message that includes line folding
1396   (i.e., that has any field-value that contains a match to the
1397   <x:ref>obs-fold</x:ref> rule) unless the message is intended for packaging
1398   within the message/http media type.
1401   A server that receives an <x:ref>obs-fold</x:ref> in a request message that
1402   is not within a message/http container &MUST; either reject the message by
1403   sending a <x:ref>400 (Bad Request)</x:ref>, preferably with a
1404   representation explaining that obsolete line folding is unacceptable, or
1405   replace each received <x:ref>obs-fold</x:ref> with one or more
1406   <x:ref>SP</x:ref> octets prior to interpreting the field value or
1407   forwarding the message downstream.
1410   A proxy or gateway that receives an <x:ref>obs-fold</x:ref> in a response
1411   message that is not within a message/http container &MUST; either discard
1412   the message and replace it with a <x:ref>502 (Bad Gateway)</x:ref>
1413   response, preferably with a representation explaining that unacceptable
1414   line folding was received, or replace each received <x:ref>obs-fold</x:ref>
1415   with one or more <x:ref>SP</x:ref> octets prior to interpreting the field
1416   value or forwarding the message downstream.
1419   A user agent that receives an <x:ref>obs-fold</x:ref> in a response message
1420   that is not within a message/http container &MUST; replace each received
1421   <x:ref>obs-fold</x:ref> with one or more <x:ref>SP</x:ref> octets prior to
1422   interpreting the field value.
1425   Historically, HTTP has allowed field content with text in the ISO&nbhy;8859&nbhy;1
1426   charset <xref target="ISO-8859-1"/>, supporting other charsets only
1427   through use of <xref target="RFC2047"/> encoding.
1428   In practice, most HTTP header field values use only a subset of the
1429   US-ASCII charset <xref target="USASCII"/>. Newly defined
1430   header fields &SHOULD; limit their field values to US&nbhy;ASCII octets.
1431   A recipient &SHOULD; treat other octets in field content (obs&nbhy;text) as
1432   opaque data.
1436<section title="Field Limits" anchor="field.limits">
1438   HTTP does not place a predefined limit on the length of each header field
1439   or on the length of the header section as a whole, as described in
1440   <xref target="conformance"/>. Various ad hoc limitations on individual
1441   header field length are found in practice, often depending on the specific
1442   field semantics.
1445   A server that receives a request header field, or set of fields, larger
1446   than it wishes to process &MUST; respond with an appropriate
1447   <x:ref>4xx (Client Error)</x:ref> status code. Ignoring such header fields
1448   would increase the server's vulnerability to request smuggling attacks
1449   (<xref target="request.smuggling"/>).
1452   A client &MAY; discard or truncate received header fields that are larger
1453   than the client wishes to process if the field semantics are such that the
1454   dropped value(s) can be safely ignored without changing the
1455   message framing or response semantics.
1459<section title="Field Value Components" anchor="field.components">
1460<t anchor="rule.token.separators">
1461  <x:anchor-alias value="tchar"/>
1462  <x:anchor-alias value="token"/>
1463  <iref item="Delimiters"/>
1464   Most HTTP header field values are defined using common syntax components
1465   (token, quoted-string, and comment) separated by whitespace or specific
1466   delimiting characters. Delimiters are chosen from the set of US-ASCII
1467   visual characters not allowed in a <x:ref>token</x:ref>
1468   (DQUOTE and "(),/:;&lt;=>?@[\]{}").
1470<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="token"/><iref primary="true" item="Grammar" subitem="tchar"/>
1471  <x:ref>token</x:ref>          = 1*<x:ref>tchar</x:ref>
1473  NOTE: the definition of tchar and the prose above about special characters need to match!
1474 -->
1475  <x:ref>tchar</x:ref>          = "!" / "#" / "$" / "%" / "&amp;" / "'" / "*"
1476                 / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
1477                 / <x:ref>DIGIT</x:ref> / <x:ref>ALPHA</x:ref>
1478                 ; any <x:ref>VCHAR</x:ref>, except delimiters
1480<t anchor="rule.quoted-string">
1481  <x:anchor-alias value="quoted-string"/>
1482  <x:anchor-alias value="qdtext"/>
1483  <x:anchor-alias value="obs-text"/>
1484   A string of text is parsed as a single value if it is quoted using
1485   double-quote marks.
1487<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="quoted-string"/><iref primary="true" item="Grammar" subitem="qdtext"/><iref primary="true" item="Grammar" subitem="obs-text"/>
1488  <x:ref>quoted-string</x:ref>  = <x:ref>DQUOTE</x:ref> *( <x:ref>qdtext</x:ref> / <x:ref>quoted-pair</x:ref> ) <x:ref>DQUOTE</x:ref>
1489  <x:ref>qdtext</x:ref>         = <x:ref>HTAB</x:ref> / <x:ref>SP</x:ref> /%x21 / %x23-5B / %x5D-7E / <x:ref>obs-text</x:ref>
1490  <x:ref>obs-text</x:ref>       = %x80-FF
1492<t anchor="rule.comment">
1493  <x:anchor-alias value="comment"/>
1494  <x:anchor-alias value="ctext"/>
1495   Comments can be included in some HTTP header fields by surrounding
1496   the comment text with parentheses. Comments are only allowed in
1497   fields containing "comment" as part of their field value definition.
1499<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="comment"/><iref primary="true" item="Grammar" subitem="ctext"/>
1500  <x:ref>comment</x:ref>        = "(" *( <x:ref>ctext</x:ref> / <x:ref>quoted-pair</x:ref> / <x:ref>comment</x:ref> ) ")"
1501  <x:ref>ctext</x:ref>          = <x:ref>HTAB</x:ref> / <x:ref>SP</x:ref> / %x21-27 / %x2A-5B / %x5D-7E / <x:ref>obs-text</x:ref>
1503<t anchor="rule.quoted-pair">
1504  <x:anchor-alias value="quoted-pair"/>
1505   The backslash octet ("\") can be used as a single-octet
1506   quoting mechanism within quoted-string and comment constructs.
1507   Recipients that process the value of a quoted-string &MUST; handle a
1508   quoted-pair as if it were replaced by the octet following the backslash.
1510<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="quoted-pair"/>
1511  <x:ref>quoted-pair</x:ref>    = "\" ( <x:ref>HTAB</x:ref> / <x:ref>SP</x:ref> / <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref> )
1514   A sender &SHOULD-NOT; generate a quoted-pair in a quoted-string except
1515   where necessary to quote DQUOTE and backslash octets occurring within that
1516   string.
1517   A sender &SHOULD-NOT; generate a quoted-pair in a comment except
1518   where necessary to quote parentheses ["(" and ")"] and backslash octets
1519   occurring within that comment.
1525<section title="Message Body" anchor="message.body">
1526  <x:anchor-alias value="message-body"/>
1528   The message body (if any) of an HTTP message is used to carry the
1529   payload body of that request or response.  The message body is
1530   identical to the payload body unless a transfer coding has been
1531   applied, as described in <xref target="header.transfer-encoding"/>.
1533<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="message-body"/>
1534  <x:ref>message-body</x:ref> = *OCTET
1537   The rules for when a message body is allowed in a message differ for
1538   requests and responses.
1541   The presence of a message body in a request is signaled by a
1542   <x:ref>Content-Length</x:ref> or <x:ref>Transfer-Encoding</x:ref> header
1543   field. Request message framing is independent of method semantics,
1544   even if the method does not define any use for a message body.
1547   The presence of a message body in a response depends on both
1548   the request method to which it is responding and the response
1549   status code (<xref target="status.line"/>).
1550   Responses to the HEAD request method (&HEAD;) never include a message body
1551   because the associated response header fields (e.g.,
1552   <x:ref>Transfer-Encoding</x:ref>, <x:ref>Content-Length</x:ref>, etc.),
1553   if present, indicate only what their values would have been if the request
1554   method had been GET (&GET;).
1555   <x:ref>2xx (Successful)</x:ref> responses to a CONNECT request method
1556   (&CONNECT;) switch to tunnel mode instead of having a message body.
1557   All <x:ref>1xx (Informational)</x:ref>, <x:ref>204 (No Content)</x:ref>, and
1558   <x:ref>304 (Not Modified)</x:ref> responses do not include a message body.
1559   All other responses do include a message body, although the body
1560   might be of zero length.
1563<section title="Transfer-Encoding" anchor="header.transfer-encoding">
1564  <iref primary="true" item="Transfer-Encoding header field" x:for-anchor=""/>
1565  <iref item="chunked (Coding Format)"/>
1566  <x:anchor-alias value="Transfer-Encoding"/>
1568   The Transfer-Encoding header field lists the transfer coding names
1569   corresponding to the sequence of transfer codings that have been
1570   (or will be) applied to the payload body in order to form the message body.
1571   Transfer codings are defined in <xref target="transfer.codings"/>.
1573<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Transfer-Encoding"/>
1574  <x:ref>Transfer-Encoding</x:ref> = 1#<x:ref>transfer-coding</x:ref>
1577   Transfer-Encoding is analogous to the Content-Transfer-Encoding field of
1578   MIME, which was designed to enable safe transport of binary data over a
1579   7-bit transport service (<xref target="RFC2045" x:fmt="," x:sec="6"/>).
1580   However, safe transport has a different focus for an 8bit-clean transfer
1581   protocol. In HTTP's case, Transfer-Encoding is primarily intended to
1582   accurately delimit a dynamically generated payload and to distinguish
1583   payload encodings that are only applied for transport efficiency or
1584   security from those that are characteristics of the selected resource.
1587   A recipient &MUST; be able to parse the chunked transfer coding
1588   (<xref target="chunked.encoding"/>) because it plays a crucial role in
1589   framing messages when the payload body size is not known in advance.
1590   A sender &MUST-NOT; apply chunked more than once to a message body
1591   (i.e., chunking an already chunked message is not allowed).
1592   If any transfer coding other than chunked is applied to a request payload
1593   body, the sender &MUST; apply chunked as the final transfer coding to
1594   ensure that the message is properly framed.
1595   If any transfer coding other than chunked is applied to a response payload
1596   body, the sender &MUST; either apply chunked as the final transfer coding
1597   or terminate the message by closing the connection.
1600   For example,
1601</preamble><artwork type="example">
1602  Transfer-Encoding: gzip, chunked
1604   indicates that the payload body has been compressed using the gzip
1605   coding and then chunked using the chunked coding while forming the
1606   message body.
1609   Unlike <x:ref>Content-Encoding</x:ref> (&content-codings;),
1610   Transfer-Encoding is a property of the message, not of the representation, and
1611   any recipient along the request/response chain &MAY; decode the received
1612   transfer coding(s) or apply additional transfer coding(s) to the message
1613   body, assuming that corresponding changes are made to the Transfer-Encoding
1614   field-value. Additional information about the encoding parameters can be
1615   provided by other header fields not defined by this specification.
1618   Transfer-Encoding &MAY; be sent in a response to a HEAD request or in a
1619   <x:ref>304 (Not Modified)</x:ref> response (&status-304;) to a GET request,
1620   neither of which includes a message body,
1621   to indicate that the origin server would have applied a transfer coding
1622   to the message body if the request had been an unconditional GET.
1623   This indication is not required, however, because any recipient on
1624   the response chain (including the origin server) can remove transfer
1625   codings when they are not needed.
1628   A server &MUST-NOT; send a Transfer-Encoding header field in any response
1629   with a status code of
1630   <x:ref>1xx (Informational)</x:ref> or <x:ref>204 (No Content)</x:ref>.
1631   A server &MUST-NOT; send a Transfer-Encoding header field in any
1632   <x:ref>2xx (Successful)</x:ref> response to a CONNECT request (&CONNECT;).
1635   Transfer-Encoding was added in HTTP/1.1.  It is generally assumed that
1636   implementations advertising only HTTP/1.0 support will not understand
1637   how to process a transfer-encoded payload.
1638   A client &MUST-NOT; send a request containing Transfer-Encoding unless it
1639   knows the server will handle HTTP/1.1 (or later) requests; such knowledge
1640   might be in the form of specific user configuration or by remembering the
1641   version of a prior received response.
1642   A server &MUST-NOT; send a response containing Transfer-Encoding unless
1643   the corresponding request indicates HTTP/1.1 (or later).
1646   A server that receives a request message with a transfer coding it does
1647   not understand &SHOULD; respond with <x:ref>501 (Not Implemented)</x:ref>.
1651<section title="Content-Length" anchor="header.content-length">
1652  <iref primary="true" item="Content-Length header field" x:for-anchor=""/>
1653  <x:anchor-alias value="Content-Length"/>
1655   When a message does not have a <x:ref>Transfer-Encoding</x:ref> header
1656   field, a Content-Length header field can provide the anticipated size,
1657   as a decimal number of octets, for a potential payload body.
1658   For messages that do include a payload body, the Content-Length field-value
1659   provides the framing information necessary for determining where the body
1660   (and message) ends.  For messages that do not include a payload body, the
1661   Content-Length indicates the size of the selected representation
1662   (&representation;).
1664<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Length"/>
1665  <x:ref>Content-Length</x:ref> = 1*<x:ref>DIGIT</x:ref>
1668   An example is
1670<figure><artwork type="example">
1671  Content-Length: 3495
1674   A sender &MUST-NOT; send a Content-Length header field in any message that
1675   contains a <x:ref>Transfer-Encoding</x:ref> header field.
1678   A user agent &SHOULD; send a Content-Length in a request message when no
1679   <x:ref>Transfer-Encoding</x:ref> is sent and the request method defines
1680   a meaning for an enclosed payload body. For example, a Content-Length
1681   header field is normally sent in a POST request even when the value is
1682   0 (indicating an empty payload body).  A user agent &SHOULD-NOT; send a
1683   Content-Length header field when the request message does not contain a
1684   payload body and the method semantics do not anticipate such a body.
1687   A server &MAY; send a Content-Length header field in a response to a HEAD
1688   request (&HEAD;); a server &MUST-NOT; send Content-Length in such a
1689   response unless its field-value equals the decimal number of octets that
1690   would have been sent in the payload body of a response if the same
1691   request had used the GET method.
1694   A server &MAY; send a Content-Length header field in a
1695   <x:ref>304 (Not Modified)</x:ref> response to a conditional GET request
1696   (&status-304;); a server &MUST-NOT; send Content-Length in such a
1697   response unless its field-value equals the decimal number of octets that
1698   would have been sent in the payload body of a <x:ref>200 (OK)</x:ref>
1699   response to the same request.
1702   A server &MUST-NOT; send a Content-Length header field in any response
1703   with a status code of
1704   <x:ref>1xx (Informational)</x:ref> or <x:ref>204 (No Content)</x:ref>.
1705   A server &MUST-NOT; send a Content-Length header field in any
1706   <x:ref>2xx (Successful)</x:ref> response to a CONNECT request (&CONNECT;).
1709   Aside from the cases defined above, in the absence of Transfer-Encoding,
1710   an origin server &SHOULD; send a Content-Length header field when the
1711   payload body size is known prior to sending the complete header section.
1712   This will allow downstream recipients to measure transfer progress,
1713   know when a received message is complete, and potentially reuse the
1714   connection for additional requests.
1717   Any Content-Length field value greater than or equal to zero is valid.
1718   Since there is no predefined limit to the length of a payload, a
1719   recipient &MUST; anticipate potentially large decimal numerals and
1720   prevent parsing errors due to integer conversion overflows
1721   (<xref target="attack.protocol.element.length"/>).
1724   If a message is received that has multiple Content-Length header fields
1725   with field-values consisting of the same decimal value, or a single
1726   Content-Length header field with a field value containing a list of
1727   identical decimal values (e.g., "Content-Length: 42, 42"), indicating that
1728   duplicate Content-Length header fields have been generated or combined by an
1729   upstream message processor, then the recipient &MUST; either reject the
1730   message as invalid or replace the duplicated field-values with a single
1731   valid Content-Length field containing that decimal value prior to
1732   determining the message body length or forwarding the message.
1735  <t>
1736   &Note; HTTP's use of Content-Length for message framing differs
1737   significantly from the same field's use in MIME, where it is an optional
1738   field used only within the "message/external-body" media-type.
1739  </t>
1743<section title="Message Body Length" anchor="message.body.length">
1744  <iref item="chunked (Coding Format)"/>
1746   The length of a message body is determined by one of the following
1747   (in order of precedence):
1750  <list style="numbers">
1751    <x:lt><t>
1752     Any response to a HEAD request and any response with a
1753     <x:ref>1xx (Informational)</x:ref>, <x:ref>204 (No Content)</x:ref>, or
1754     <x:ref>304 (Not Modified)</x:ref> status code is always
1755     terminated by the first empty line after the header fields, regardless of
1756     the header fields present in the message, and thus cannot contain a
1757     message body.
1758    </t></x:lt>
1759    <x:lt><t>
1760     Any <x:ref>2xx (Successful)</x:ref> response to a CONNECT request implies that the
1761     connection will become a tunnel immediately after the empty line that
1762     concludes the header fields.  A client &MUST; ignore any
1763     <x:ref>Content-Length</x:ref> or <x:ref>Transfer-Encoding</x:ref> header
1764     fields received in such a message.
1765    </t></x:lt>
1766    <x:lt><t>
1767     If a <x:ref>Transfer-Encoding</x:ref> header field is present
1768     and the chunked transfer coding (<xref target="chunked.encoding"/>)
1769     is the final encoding, the message body length is determined by reading
1770     and decoding the chunked data until the transfer coding indicates the
1771     data is complete.
1772    </t>
1773    <t>
1774     If a <x:ref>Transfer-Encoding</x:ref> header field is present in a
1775     response and the chunked transfer coding is not the final encoding, the
1776     message body length is determined by reading the connection until it is
1777     closed by the server.
1778     If a <x:ref>Transfer-Encoding</x:ref> header field is present in a request and the
1779     chunked transfer coding is not the final encoding, the message body
1780     length cannot be determined reliably; the server &MUST; respond with
1781     the <x:ref>400 (Bad Request)</x:ref> status code and then close the connection.
1782    </t>
1783    <t>
1784     If a message is received with both a <x:ref>Transfer-Encoding</x:ref>
1785     and a <x:ref>Content-Length</x:ref> header field, the Transfer-Encoding
1786     overrides the Content-Length. Such a message might indicate an attempt to
1787     perform request smuggling (<xref target="request.smuggling"/>) or
1788     response splitting (<xref target="response.splitting"/>) and ought to be
1789     handled as an error. A sender &MUST; remove the received Content-Length
1790     field prior to forwarding such a message downstream.
1791    </t></x:lt>
1792    <x:lt><t>
1793     If a message is received without <x:ref>Transfer-Encoding</x:ref> and with
1794     either multiple <x:ref>Content-Length</x:ref> header fields having
1795     differing field-values or a single Content-Length header field having an
1796     invalid value, then the message framing is invalid and
1797     the recipient &MUST; treat it as an unrecoverable error.
1798     If this is a request message, the server &MUST; respond with
1799     a <x:ref>400 (Bad Request)</x:ref> status code and then close the connection.
1800     If this is a response message received by a proxy,
1801     the proxy &MUST; close the connection to the server, discard the received
1802     response, and send a <x:ref>502 (Bad Gateway)</x:ref> response to the
1803     client.
1804     If this is a response message received by a user agent,
1805     the user agent &MUST; close the connection to the server and discard the
1806     received response.
1807    </t></x:lt>
1808    <x:lt><t>
1809     If a valid <x:ref>Content-Length</x:ref> header field is present without
1810     <x:ref>Transfer-Encoding</x:ref>, its decimal value defines the
1811     expected message body length in octets.
1812     If the sender closes the connection or the recipient times out before the
1813     indicated number of octets are received, the recipient &MUST; consider
1814     the message to be incomplete and close the connection.
1815    </t></x:lt>
1816    <x:lt><t>
1817     If this is a request message and none of the above are true, then the
1818     message body length is zero (no message body is present).
1819    </t></x:lt>
1820    <x:lt><t>
1821     Otherwise, this is a response message without a declared message body
1822     length, so the message body length is determined by the number of octets
1823     received prior to the server closing the connection.
1824    </t></x:lt>
1825  </list>
1828   Since there is no way to distinguish a successfully completed,
1829   close-delimited message from a partially received message interrupted
1830   by network failure, a server &SHOULD; generate encoding or
1831   length-delimited messages whenever possible.  The close-delimiting
1832   feature exists primarily for backwards compatibility with HTTP/1.0.
1835   A server &MAY; reject a request that contains a message body but
1836   not a <x:ref>Content-Length</x:ref> by responding with
1837   <x:ref>411 (Length Required)</x:ref>.
1840   Unless a transfer coding other than chunked has been applied,
1841   a client that sends a request containing a message body &SHOULD;
1842   use a valid <x:ref>Content-Length</x:ref> header field if the message body
1843   length is known in advance, rather than the chunked transfer coding, since some
1844   existing services respond to chunked with a <x:ref>411 (Length Required)</x:ref>
1845   status code even though they understand the chunked transfer coding.  This
1846   is typically because such services are implemented via a gateway that
1847   requires a content-length in advance of being called and the server
1848   is unable or unwilling to buffer the entire request before processing.
1851   A user agent that sends a request containing a message body &MUST; send a
1852   valid <x:ref>Content-Length</x:ref> header field if it does not know the
1853   server will handle HTTP/1.1 (or later) requests; such knowledge can be in
1854   the form of specific user configuration or by remembering the version of a
1855   prior received response.
1858   If the final response to the last request on a connection has been
1859   completely received and there remains additional data to read, a user agent
1860   &MAY; discard the remaining data or attempt to determine if that data
1861   belongs as part of the prior response body, which might be the case if the
1862   prior message's Content-Length value is incorrect. A client &MUST-NOT;
1863   process, cache, or forward such extra data as a separate response, since
1864   such behavior would be vulnerable to cache poisoning.
1869<section anchor="incomplete.messages" title="Handling Incomplete Messages">
1871   A server that receives an incomplete request message, usually due to a
1872   canceled request or a triggered timeout exception, &MAY; send an error
1873   response prior to closing the connection.
1876   A client that receives an incomplete response message, which can occur
1877   when a connection is closed prematurely or when decoding a supposedly
1878   chunked transfer coding fails, &MUST; record the message as incomplete.
1879   Cache requirements for incomplete responses are defined in
1880   &cache-incomplete;.
1883   If a response terminates in the middle of the header section (before the
1884   empty line is received) and the status code might rely on header fields to
1885   convey the full meaning of the response, then the client cannot assume
1886   that meaning has been conveyed; the client might need to repeat the
1887   request in order to determine what action to take next.
1890   A message body that uses the chunked transfer coding is
1891   incomplete if the zero-sized chunk that terminates the encoding has not
1892   been received.  A message that uses a valid <x:ref>Content-Length</x:ref> is
1893   incomplete if the size of the message body received (in octets) is less than
1894   the value given by Content-Length.  A response that has neither chunked
1895   transfer coding nor Content-Length is terminated by closure of the
1896   connection and, thus, is considered complete regardless of the number of
1897   message body octets received, provided that the header section was received
1898   intact.
1902<section title="Message Parsing Robustness" anchor="message.robustness">
1904   Older HTTP/1.0 user agent implementations might send an extra CRLF
1905   after a POST request as a workaround for some early server
1906   applications that failed to read message body content that was
1907   not terminated by a line-ending. An HTTP/1.1 user agent &MUST-NOT;
1908   preface or follow a request with an extra CRLF.  If terminating
1909   the request message body with a line-ending is desired, then the
1910   user agent &MUST; count the terminating CRLF octets as part of the
1911   message body length.
1914   In the interest of robustness, a server that is expecting to receive and
1915   parse a request-line &SHOULD; ignore at least one empty line (CRLF)
1916   received prior to the request-line.
1919   Although the line terminator for the start-line and header
1920   fields is the sequence CRLF, a recipient &MAY; recognize a
1921   single LF as a line terminator and ignore any preceding CR.
1924   Although the request-line and status-line grammar rules require that each
1925   of the component elements be separated by a single SP octet, recipients
1926   &MAY; instead parse on whitespace-delimited word boundaries and, aside
1927   from the CRLF terminator, treat any form of whitespace as the SP separator
1928   while ignoring preceding or trailing whitespace;
1929   such whitespace includes one or more of the following octets:
1930   SP, HTAB, VT (%x0B), FF (%x0C), or bare CR.
1931   However, lenient parsing can result in security vulnerabilities if there
1932   are multiple recipients of the message and each has its own unique
1933   interpretation of robustness (see <xref target="request.smuggling"/>).
1936   When a server listening only for HTTP request messages, or processing
1937   what appears from the start-line to be an HTTP request message,
1938   receives a sequence of octets that does not match the HTTP-message
1939   grammar aside from the robustness exceptions listed above, the
1940   server &SHOULD; respond with a <x:ref>400 (Bad Request)</x:ref> response. 
1945<section title="Transfer Codings" anchor="transfer.codings">
1946  <x:anchor-alias value="transfer-coding"/>
1947  <x:anchor-alias value="transfer-extension"/>
1949   Transfer coding names are used to indicate an encoding
1950   transformation that has been, can be, or might need to be applied to a
1951   payload body in order to ensure "safe transport" through the network.
1952   This differs from a content coding in that the transfer coding is a
1953   property of the message rather than a property of the representation
1954   that is being transferred.
1956<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="transfer-coding"/><iref primary="true" item="Grammar" subitem="transfer-extension"/>
1957  <x:ref>transfer-coding</x:ref>    = "chunked" ; <xref target="chunked.encoding"/>
1958                     / "compress" ; <xref target="compress.coding"/>
1959                     / "deflate" ; <xref target="deflate.coding"/>
1960                     / "gzip" ; <xref target="gzip.coding"/>
1961                     / <x:ref>transfer-extension</x:ref>
1962  <x:ref>transfer-extension</x:ref> = <x:ref>token</x:ref> *( <x:ref>OWS</x:ref> ";" <x:ref>OWS</x:ref> <x:ref>transfer-parameter</x:ref> )
1964<t anchor="rule.parameter">
1965  <x:anchor-alias value="transfer-parameter"/>
1966   Parameters are in the form of a name or name=value pair.
1968<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="transfer-parameter"/>
1969  <x:ref>transfer-parameter</x:ref> = <x:ref>token</x:ref> <x:ref>BWS</x:ref> "=" <x:ref>BWS</x:ref> ( <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref> )
1972   All transfer-coding names are case-insensitive and ought to be registered
1973   within the HTTP Transfer Coding registry, as defined in
1974   <xref target="transfer.coding.registry"/>.
1975   They are used in the <x:ref>TE</x:ref> (<xref target="header.te"/>) and
1976   <x:ref>Transfer-Encoding</x:ref> (<xref target="header.transfer-encoding"/>)
1977   header fields.
1980<section title="Chunked Transfer Coding" anchor="chunked.encoding">
1981  <iref primary="true" item="chunked (Coding Format)"/>
1982  <x:anchor-alias value="chunk"/>
1983  <x:anchor-alias value="chunked-body"/>
1984  <x:anchor-alias value="chunk-data"/>
1985  <x:anchor-alias value="chunk-size"/>
1986  <x:anchor-alias value="last-chunk"/>
1988   The chunked transfer coding wraps the payload body in order to transfer it
1989   as a series of chunks, each with its own size indicator, followed by an
1990   &OPTIONAL; trailer containing header fields. Chunked enables content
1991   streams of unknown size to be transferred as a sequence of length-delimited
1992   buffers, which enables the sender to retain connection persistence and the
1993   recipient to know when it has received the entire message.
1995<figure><artwork type="abnf2616"><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"/>
1996  <x:ref>chunked-body</x:ref>   = *<x:ref>chunk</x:ref>
1997                   <x:ref>last-chunk</x:ref>
1998                   <x:ref>trailer-part</x:ref>
1999                   <x:ref>CRLF</x:ref>
2001  <x:ref>chunk</x:ref>          = <x:ref>chunk-size</x:ref> [ <x:ref>chunk-ext</x:ref> ] <x:ref>CRLF</x:ref>
2002                   <x:ref>chunk-data</x:ref> <x:ref>CRLF</x:ref>
2003  <x:ref>chunk-size</x:ref>     = 1*<x:ref>HEXDIG</x:ref>
2004  <x:ref>last-chunk</x:ref>     = 1*("0") [ <x:ref>chunk-ext</x:ref> ] <x:ref>CRLF</x:ref>
2006  <x:ref>chunk-data</x:ref>     = 1*<x:ref>OCTET</x:ref> ; a sequence of chunk-size octets
2009   The chunk-size field is a string of hex digits indicating the size of
2010   the chunk-data in octets. The chunked transfer coding is complete when a
2011   chunk with a chunk-size of zero is received, possibly followed by a
2012   trailer, and finally terminated by an empty line.
2015   A recipient &MUST; be able to parse and decode the chunked transfer coding.
2018<section title="Chunk Extensions" anchor="chunked.extension">
2019  <x:anchor-alias value="chunk-ext"/>
2020  <x:anchor-alias value="chunk-ext-name"/>
2021  <x:anchor-alias value="chunk-ext-val"/>
2023   The chunked encoding allows each chunk to include zero or more chunk
2024   extensions, immediately following the <x:ref>chunk-size</x:ref>, for the
2025   sake of supplying per-chunk metadata (such as a signature or hash),
2026   mid-message control information, or randomization of message body size.
2028<figure><artwork type="abnf2616"><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"/>
2029  <x:ref>chunk-ext</x:ref>      = *( ";" <x:ref>chunk-ext-name</x:ref> [ "=" <x:ref>chunk-ext-val</x:ref> ] )
2031  <x:ref>chunk-ext-name</x:ref> = <x:ref>token</x:ref>
2032  <x:ref>chunk-ext-val</x:ref>  = <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref>
2035   The chunked encoding is specific to each connection and is likely to be
2036   removed or recoded by each recipient (including intermediaries) before any
2037   higher-level application would have a chance to inspect the extensions.
2038   Hence, use of chunk extensions is generally limited to specialized HTTP
2039   services such as "long polling" (where client and server can have shared
2040   expectations regarding the use of chunk extensions) or for padding within
2041   an end-to-end secured connection.
2044   A recipient &MUST; ignore unrecognized chunk extensions.
2045   A server ought to limit the total length of chunk extensions received in a
2046   request to an amount reasonable for the services provided, in the same way
2047   that it applies length limitations and timeouts for other parts of a
2048   message, and generate an appropriate <x:ref>4xx (Client Error)</x:ref>
2049   response if that amount is exceeded.
2053<section title="Chunked Trailer Part" anchor="chunked.trailer.part">
2054  <x:anchor-alias value="trailer-part"/>
2056   A trailer allows the sender to include additional fields at the end of a
2057   chunked message in order to supply metadata that might be dynamically
2058   generated while the message body is sent, such as a message integrity
2059   check, digital signature, or post-processing status. The trailer fields are
2060   identical to header fields, except they are sent in a chunked trailer
2061   instead of the message's header section.
2063<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="trailer-part"/><iref primary="false" item="Grammar" subitem="header-field"/>
2064  <x:ref>trailer-part</x:ref>   = *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> )
2067   A sender &MUST-NOT; generate a trailer that contains a field necessary for
2068   message framing (e.g., <x:ref>Transfer-Encoding</x:ref> and
2069   <x:ref>Content-Length</x:ref>), routing (e.g., <x:ref>Host</x:ref>),
2070   request modifiers (e.g., controls and conditionals in
2071   &request-header-fields;), authentication (e.g., see <xref target="RFC7235"/>
2072   and <xref target="RFC6265"/>), response control data (e.g., see
2073   &response-control-data;), or determining how to process the payload
2074   (e.g., <x:ref>Content-Encoding</x:ref>, <x:ref>Content-Type</x:ref>,
2075   <x:ref>Content-Range</x:ref>, and <x:ref>Trailer</x:ref>).
2078   When a chunked message containing a non-empty trailer is received, the
2079   recipient &MAY; process the fields (aside from those forbidden above)
2080   as if they were appended to the message's header section.
2081   A recipient &MUST; ignore (or consider as an error) any fields that are
2082   forbidden to be sent in a trailer, since processing them as if they were
2083   present in the header section might bypass external security filters.
2086   Unless the request includes a <x:ref>TE</x:ref> header field indicating
2087   "trailers" is acceptable, as described in <xref target="header.te"/>, a
2088   server &SHOULD-NOT; generate trailer fields that it believes are necessary
2089   for the user agent to receive. Without a TE containing "trailers", the
2090   server ought to assume that the trailer fields might be silently discarded
2091   along the path to the user agent. This requirement allows intermediaries to
2092   forward a de-chunked message to an HTTP/1.0 recipient without buffering the
2093   entire response.
2097<section title="Decoding Chunked" anchor="decoding.chunked">
2099   A process for decoding the chunked transfer coding
2100   can be represented in pseudo-code as:
2102<figure><artwork type="code">
2103  length := 0
2104  read chunk-size, chunk-ext (if any), and CRLF
2105  while (chunk-size &gt; 0) {
2106     read chunk-data and CRLF
2107     append chunk-data to decoded-body
2108     length := length + chunk-size
2109     read chunk-size, chunk-ext (if any), and CRLF
2110  }
2111  read trailer field
2112  while (trailer field is not empty) {
2113     if (trailer field is allowed to be sent in a trailer) {
2114         append trailer field to existing header fields
2115     }
2116     read trailer-field
2117  }
2118  Content-Length := length
2119  Remove "chunked" from Transfer-Encoding
2120  Remove Trailer from existing header fields
2125<section title="Compression Codings" anchor="compression.codings">
2127   The codings defined below can be used to compress the payload of a
2128   message.
2131<section title="Compress Coding" anchor="compress.coding">
2132<iref item="compress (Coding Format)"/>
2134   The "compress" coding is an adaptive Lempel-Ziv-Welch (LZW) coding
2135   <xref target="Welch"/> that is commonly produced by the UNIX file
2136   compression program "compress".
2137   A recipient &SHOULD; consider "x-compress" to be equivalent to "compress".
2141<section title="Deflate Coding" anchor="deflate.coding">
2142<iref item="deflate (Coding Format)"/>
2144   The "deflate" coding is a "zlib" data format <xref target="RFC1950"/>
2145   containing a "deflate" compressed data stream <xref target="RFC1951"/>
2146   that uses a combination of the Lempel-Ziv (LZ77) compression algorithm and
2147   Huffman coding.
2150  <t>
2151    &Note; Some non-conformant implementations send the "deflate"
2152    compressed data without the zlib wrapper.
2153   </t>
2157<section title="Gzip Coding" anchor="gzip.coding">
2158<iref item="gzip (Coding Format)"/>
2160   The "gzip" coding is an LZ77 coding with a 32-bit Cyclic Redundancy Check
2161   (CRC) that is commonly
2162   produced by the gzip file compression program <xref target="RFC1952"/>.
2163   A recipient &SHOULD; consider "x-gzip" to be equivalent to "gzip".
2169<section title="TE" anchor="header.te">
2170  <iref primary="true" item="TE header field" x:for-anchor=""/>
2171  <x:anchor-alias value="TE"/>
2172  <x:anchor-alias value="t-codings"/>
2173  <x:anchor-alias value="t-ranking"/>
2174  <x:anchor-alias value="rank"/>
2176   The "TE" header field in a request indicates what transfer codings,
2177   besides chunked, the client is willing to accept in response, and
2178   whether or not the client is willing to accept trailer fields in a
2179   chunked transfer coding.
2182   The TE field-value consists of a comma-separated list of transfer coding
2183   names, each allowing for optional parameters (as described in
2184   <xref target="transfer.codings"/>), and/or the keyword "trailers".
2185   A client &MUST-NOT; send the chunked transfer coding name in TE;
2186   chunked is always acceptable for HTTP/1.1 recipients.
2188<figure><artwork type="abnf2616"><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"/>
2189  <x:ref>TE</x:ref>        = #<x:ref>t-codings</x:ref>
2190  <x:ref>t-codings</x:ref> = "trailers" / ( <x:ref>transfer-coding</x:ref> [ <x:ref>t-ranking</x:ref> ] )
2191  <x:ref>t-ranking</x:ref> = <x:ref>OWS</x:ref> ";" <x:ref>OWS</x:ref> "q=" <x:ref>rank</x:ref>
2192  <x:ref>rank</x:ref>      = ( "0" [ "." 0*3<x:ref>DIGIT</x:ref> ] )
2193             / ( "1" [ "." 0*3("0") ] )
2196   Three examples of TE use are below.
2198<figure><artwork type="example">
2199  TE: deflate
2200  TE:
2201  TE: trailers, deflate;q=0.5
2204   The presence of the keyword "trailers" indicates that the client is willing
2205   to accept trailer fields in a chunked transfer coding, as defined in
2206   <xref target="chunked.trailer.part"/>, on behalf of itself and any downstream
2207   clients. For requests from an intermediary, this implies that either:
2208   (a) all downstream clients are willing to accept trailer fields in the
2209   forwarded response; or,
2210   (b) the intermediary will attempt to buffer the response on behalf of
2211   downstream recipients.
2212   Note that HTTP/1.1 does not define any means to limit the size of a
2213   chunked response such that an intermediary can be assured of buffering the
2214   entire response.
2217   When multiple transfer codings are acceptable, the client &MAY; rank the
2218   codings by preference using a case-insensitive "q" parameter (similar to
2219   the qvalues used in content negotiation fields, &qvalue;). The rank value
2220   is a real number in the range 0 through 1, where 0.001 is the least
2221   preferred and 1 is the most preferred; a value of 0 means "not acceptable".
2224   If the TE field-value is empty or if no TE field is present, the only
2225   acceptable transfer coding is chunked. A message with no transfer coding
2226   is always acceptable.
2229   Since the TE header field only applies to the immediate connection,
2230   a sender of TE &MUST; also send a "TE" connection option within the
2231   <x:ref>Connection</x:ref> header field (<xref target="header.connection"/>)
2232   in order to prevent the TE field from being forwarded by intermediaries
2233   that do not support its semantics.
2237<section title="Trailer" anchor="header.trailer">
2238  <iref primary="true" item="Trailer header field" x:for-anchor=""/>
2239  <x:anchor-alias value="Trailer"/>
2241   When a message includes a message body encoded with the chunked
2242   transfer coding and the sender desires to send metadata in the form of
2243   trailer fields at the end of the message, the sender &SHOULD; generate a
2244   <x:ref>Trailer</x:ref> header field before the message body to indicate
2245   which fields will be present in the trailers. This allows the recipient
2246   to prepare for receipt of that metadata before it starts processing the body,
2247   which is useful if the message is being streamed and the recipient wishes
2248   to confirm an integrity check on the fly.
2250<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Trailer"/><iref primary="false" item="Grammar" subitem="field-name"/>
2251  <x:ref>Trailer</x:ref> = 1#<x:ref>field-name</x:ref>
2256<section title="Message Routing" anchor="message.routing">
2258   HTTP request message routing is determined by each client based on the
2259   target resource, the client's proxy configuration, and
2260   establishment or reuse of an inbound connection.  The corresponding
2261   response routing follows the same connection chain back to the client.
2264<section title="Identifying a Target Resource" anchor="target-resource">
2265  <iref primary="true" item="target resource"/>
2266  <iref primary="true" item="target URI"/>
2267  <x:anchor-alias value="target resource"/>
2268  <x:anchor-alias value="target URI"/>
2270   HTTP is used in a wide variety of applications, ranging from
2271   general-purpose computers to home appliances.  In some cases,
2272   communication options are hard-coded in a client's configuration.
2273   However, most HTTP clients rely on the same resource identification
2274   mechanism and configuration techniques as general-purpose Web browsers.
2277   HTTP communication is initiated by a user agent for some purpose.
2278   The purpose is a combination of request semantics, which are defined in
2279   <xref target="RFC7231"/>, and a target resource upon which to apply those
2280   semantics.  A URI reference (<xref target="uri"/>) is typically used as
2281   an identifier for the "<x:dfn>target resource</x:dfn>", which a user agent
2282   would resolve to its absolute form in order to obtain the
2283   "<x:dfn>target URI</x:dfn>".  The target URI
2284   excludes the reference's fragment component, if any,
2285   since fragment identifiers are reserved for client-side processing
2286   (<xref target="RFC3986" x:fmt="," x:sec="3.5"/>).
2290<section title="Connecting Inbound" anchor="connecting.inbound">
2292   Once the target URI is determined, a client needs to decide whether
2293   a network request is necessary to accomplish the desired semantics and,
2294   if so, where that request is to be directed.
2297   If the client has a cache <xref target="RFC7234"/> and the request can be
2298   satisfied by it, then the request is
2299   usually directed there first.
2302   If the request is not satisfied by a cache, then a typical client will
2303   check its configuration to determine whether a proxy is to be used to
2304   satisfy the request.  Proxy configuration is implementation-dependent,
2305   but is often based on URI prefix matching, selective authority matching,
2306   or both, and the proxy itself is usually identified by an "http" or
2307   "https" URI.  If a proxy is applicable, the client connects inbound by
2308   establishing (or reusing) a connection to that proxy.
2311   If no proxy is applicable, a typical client will invoke a handler routine,
2312   usually specific to the target URI's scheme, to connect directly
2313   to an authority for the target resource.  How that is accomplished is
2314   dependent on the target URI scheme and defined by its associated
2315   specification, similar to how this specification defines origin server
2316   access for resolution of the "http" (<xref target="http.uri"/>) and
2317   "https" (<xref target="https.uri"/>) schemes.
2320   HTTP requirements regarding connection management are defined in
2321   <xref target=""/>.
2325<section title="Request Target" anchor="request-target">
2327   Once an inbound connection is obtained,
2328   the client sends an HTTP request message (<xref target="http.message"/>)
2329   with a request-target derived from the target URI.
2330   There are four distinct formats for the request-target, depending on both
2331   the method being requested and whether the request is to a proxy.
2333<figure><artwork type="abnf2616"><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"/>
2334  <x:ref>request-target</x:ref> = <x:ref>origin-form</x:ref>
2335                 / <x:ref>absolute-form</x:ref>
2336                 / <x:ref>authority-form</x:ref>
2337                 / <x:ref>asterisk-form</x:ref>
2340<section title="origin-form" anchor="origin-form">
2341   <iref item="origin-form (of request-target)"/>
2343   The most common form of request-target is the <x:dfn>origin-form</x:dfn>.
2345<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="origin-form"/>
2346  <x:ref>origin-form</x:ref>    = <x:ref>absolute-path</x:ref> [ "?" <x:ref>query</x:ref> ]
2349   When making a request directly to an origin server, other than a CONNECT
2350   or server-wide OPTIONS request (as detailed below),
2351   a client &MUST; send only the absolute path and query components of
2352   the target URI as the request-target.
2353   If the target URI's path component is empty, the client &MUST; send
2354   "/" as the path within the origin-form of request-target.
2355   A <x:ref>Host</x:ref> header field is also sent, as defined in
2356   <xref target=""/>.
2359   For example, a client wishing to retrieve a representation of the resource
2360   identified as
2362<figure><artwork x:indent-with="  " type="example">
2366   directly from the origin server would open (or reuse) a TCP connection
2367   to port 80 of the host "" and send the lines:
2369<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2370GET /where?q=now HTTP/1.1
2374   followed by the remainder of the request message.
2378<section title="absolute-form" anchor="absolute-form">
2379   <iref item="absolute-form (of request-target)"/>
2381   When making a request to a proxy, other than a CONNECT or server-wide
2382   OPTIONS request (as detailed below), a client &MUST; send the target URI
2383   in <x:dfn>absolute-form</x:dfn> as the request-target.
2385<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="absolute-form"/>
2386  <x:ref>absolute-form</x:ref>  = <x:ref>absolute-URI</x:ref>
2389   The proxy is requested to either service that request from a valid cache,
2390   if possible, or make the same request on the client's behalf to either
2391   the next inbound proxy server or directly to the origin server indicated
2392   by the request-target.  Requirements on such "forwarding" of messages are
2393   defined in <xref target="message.forwarding"/>.
2396   An example absolute-form of request-line would be:
2398<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2399GET HTTP/1.1
2402   To allow for transition to the absolute-form for all requests in some
2403   future version of HTTP, a server &MUST; accept the absolute-form
2404   in requests, even though HTTP/1.1 clients will only send them in requests
2405   to proxies.
2409<section title="authority-form" anchor="authority-form">
2410   <iref item="authority-form (of request-target)"/>
2412   The <x:dfn>authority-form</x:dfn> of request-target is only used for
2413   CONNECT requests (&CONNECT;).
2415<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="authority-form"/>
2416  <x:ref>authority-form</x:ref> = <x:ref>authority</x:ref>
2419   When making a CONNECT request to establish a
2420   tunnel through one or more proxies, a client &MUST; send only the target
2421   URI's authority component (excluding any userinfo and its "@" delimiter) as
2422   the request-target. For example,
2424<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2429<section title="asterisk-form" anchor="asterisk-form">
2430   <iref item="asterisk-form (of request-target)"/>
2432   The <x:dfn>asterisk-form</x:dfn> of request-target is only used for a server-wide
2433   OPTIONS request (&OPTIONS;).
2435<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="asterisk-form"/>
2436  <x:ref>asterisk-form</x:ref>  = "*"
2439   When a client wishes to request OPTIONS
2440   for the server as a whole, as opposed to a specific named resource of
2441   that server, the client &MUST; send only "*" (%x2A) as the request-target.
2442   For example,
2444<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2445OPTIONS * HTTP/1.1
2448   If a proxy receives an OPTIONS request with an absolute-form of
2449   request-target in which the URI has an empty path and no query component,
2450   then the last proxy on the request chain &MUST; send a request-target
2451   of "*" when it forwards the request to the indicated origin server.
2454   For example, the request
2455</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2459  would be forwarded by the final proxy as
2460</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2461OPTIONS * HTTP/1.1
2465   after connecting to port 8001 of host "".
2471<section title="Host" anchor="">
2472  <iref primary="true" item="Host header field" x:for-anchor=""/>
2473  <x:anchor-alias value="Host"/>
2475   The "Host" header field in a request provides the host and port
2476   information from the target URI, enabling the origin
2477   server to distinguish among resources while servicing requests
2478   for multiple host names on a single IP address.
2480<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Host"/>
2481  <x:ref>Host</x:ref> = <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ] ; <xref target="http.uri"/>
2484   A client &MUST; send a Host header field in all HTTP/1.1 request messages.
2485   If the target URI includes an authority component, then a client &MUST;
2486   send a field-value for Host that is identical to that authority
2487   component, excluding any userinfo subcomponent and its "@" delimiter
2488   (<xref target="http.uri"/>).
2489   If the authority component is missing or undefined for the target URI,
2490   then a client &MUST; send a Host header field with an empty field-value.
2493   Since the Host field-value is critical information for handling a request,
2494   a user agent &SHOULD; generate Host as the first header field following the
2495   request-line.
2498   For example, a GET request to the origin server for
2499   &lt;; would begin with:
2501<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2502GET /pub/WWW/ HTTP/1.1
2506   A client &MUST; send a Host header field in an HTTP/1.1 request even
2507   if the request-target is in the absolute-form, since this
2508   allows the Host information to be forwarded through ancient HTTP/1.0
2509   proxies that might not have implemented Host.
2512   When a proxy receives a request with an absolute-form of
2513   request-target, the proxy &MUST; ignore the received
2514   Host header field (if any) and instead replace it with the host
2515   information of the request-target.  A proxy that forwards such a request
2516   &MUST; generate a new Host field-value based on the received
2517   request-target rather than forward the received Host field-value.
2520   Since the Host header field acts as an application-level routing
2521   mechanism, it is a frequent target for malware seeking to poison
2522   a shared cache or redirect a request to an unintended server.
2523   An interception proxy is particularly vulnerable if it relies on
2524   the Host field-value for redirecting requests to internal
2525   servers, or for use as a cache key in a shared cache, without
2526   first verifying that the intercepted connection is targeting a
2527   valid IP address for that host.
2530   A server &MUST; respond with a <x:ref>400 (Bad Request)</x:ref> status code
2531   to any HTTP/1.1 request message that lacks a Host header field and
2532   to any request message that contains more than one Host header field
2533   or a Host header field with an invalid field-value.
2537<section title="Effective Request URI" anchor="effective.request.uri">
2538  <iref primary="true" item="effective request URI"/>
2539  <x:anchor-alias value="effective request URI"/>
2541   Since the request-target often contains only part of the user agent's
2542   target URI, a server reconstructs the intended target as an
2543   "<x:dfn>effective request URI</x:dfn>" to properly service the request.
2544   This reconstruction involves both the server's local configuration and
2545   information communicated in the <x:ref>request-target</x:ref>,
2546   <x:ref>Host</x:ref> header field, and connection context.
2549   For a user agent, the effective request URI is the target URI.
2552   If the <x:ref>request-target</x:ref> is in <x:ref>absolute-form</x:ref>,
2553   the effective request URI is the same as the request-target. Otherwise, the
2554   effective request URI is constructed as follows:
2555<list style="empty">
2557   If the server's configuration (or outbound gateway) provides a fixed URI
2558   <x:ref>scheme</x:ref>, that scheme is used for the effective request URI.
2559   Otherwise, if the request is received over a TLS-secured TCP connection,
2560   the effective request URI's scheme is "https"; if not, the scheme is "http".
2563   If the server's configuration (or outbound gateway) provides a fixed URI
2564   <x:ref>authority</x:ref> component, that authority is used for the
2565   effective request URI. If not, then if the request-target is in
2566   <x:ref>authority-form</x:ref>, the effective request URI's authority
2567   component is the same as the request-target.
2568   If not, then if a <x:ref>Host</x:ref> header field is supplied with a
2569   non-empty field-value, the authority component is the same as the
2570   Host field-value. Otherwise, the authority component is assigned
2571   the default name configured for the server and, if the connection's
2572   incoming TCP port number differs from the default port for the effective
2573   request URI's scheme, then a colon (":") and the incoming port number (in
2574   decimal form) are appended to the authority component.
2577   If the request-target is in <x:ref>authority-form</x:ref> or
2578   <x:ref>asterisk-form</x:ref>, the effective request URI's combined
2579   <x:ref>path</x:ref> and <x:ref>query</x:ref> component is empty. Otherwise,
2580   the combined <x:ref>path</x:ref> and <x:ref>query</x:ref> component is the
2581   same as the request-target.
2584   The components of the effective request URI, once determined as above, can
2585   be combined into <x:ref>absolute-URI</x:ref> form by concatenating the
2586   scheme, "://", authority, and combined path and query component.
2592   Example 1: the following message received over an insecure TCP connection
2594<artwork type="example" x:indent-with="  ">
2595GET /pub/WWW/TheProject.html HTTP/1.1
2601  has an effective request URI of
2603<artwork type="example" x:indent-with="  ">
2609   Example 2: the following message received over a TLS-secured TCP connection
2611<artwork type="example" x:indent-with="  ">
2612OPTIONS * HTTP/1.1
2618  has an effective request URI of
2620<artwork type="example" x:indent-with="  ">
2625   Recipients of an HTTP/1.0 request that lacks a <x:ref>Host</x:ref> header
2626   field might need to use heuristics (e.g., examination of the URI path for
2627   something unique to a particular host) in order to guess the
2628   effective request URI's authority component.
2631   Once the effective request URI has been constructed, an origin server needs
2632   to decide whether or not to provide service for that URI via the connection
2633   in which the request was received. For example, the request might have been
2634   misdirected, deliberately or accidentally, such that the information within
2635   a received <x:ref>request-target</x:ref> or <x:ref>Host</x:ref> header
2636   field differs from the host or port upon which the connection has been
2637   made. If the connection is from a trusted gateway, that inconsistency might
2638   be expected; otherwise, it might indicate an attempt to bypass security
2639   filters, trick the server into delivering non-public content, or poison a
2640   cache. See <xref target="security.considerations"/> for security
2641   considerations regarding message routing.
2645<section title="Associating a Response to a Request" anchor="">
2647   HTTP does not include a request identifier for associating a given
2648   request message with its corresponding one or more response messages.
2649   Hence, it relies on the order of response arrival to correspond exactly
2650   to the order in which requests are made on the same connection.
2651   More than one response message per request only occurs when one or more
2652   informational responses (<x:ref>1xx</x:ref>, see &status-1xx;) precede a
2653   final response to the same request.
2656   A client that has more than one outstanding request on a connection &MUST;
2657   maintain a list of outstanding requests in the order sent and &MUST;
2658   associate each received response message on that connection to the highest
2659   ordered request that has not yet received a final (non-<x:ref>1xx</x:ref>)
2660   response.
2664<section title="Message Forwarding" anchor="message.forwarding">
2666   As described in <xref target="intermediaries"/>, intermediaries can serve
2667   a variety of roles in the processing of HTTP requests and responses.
2668   Some intermediaries are used to improve performance or availability.
2669   Others are used for access control or to filter content.
2670   Since an HTTP stream has characteristics similar to a pipe-and-filter
2671   architecture, there are no inherent limits to the extent an intermediary
2672   can enhance (or interfere) with either direction of the stream.
2675   An intermediary not acting as a tunnel &MUST; implement the
2676   <x:ref>Connection</x:ref> header field, as specified in
2677   <xref target="header.connection"/>, and exclude fields from being forwarded
2678   that are only intended for the incoming connection.
2681   An intermediary &MUST-NOT; forward a message to itself unless it is
2682   protected from an infinite request loop. In general, an intermediary ought
2683   to recognize its own server names, including any aliases, local variations,
2684   or literal IP addresses, and respond to such requests directly.
2687<section title="Via" anchor="header.via">
2688  <iref primary="true" item="Via header field" x:for-anchor=""/>
2689  <x:anchor-alias value="pseudonym"/>
2690  <x:anchor-alias value="received-by"/>
2691  <x:anchor-alias value="received-protocol"/>
2692  <x:anchor-alias value="Via"/>
2694   The "Via" header field indicates the presence of intermediate protocols and
2695   recipients between the user agent and the server (on requests) or between
2696   the origin server and the client (on responses), similar to the
2697   "Received" header field in email
2698   (<xref target="RFC5322" x:fmt="of" x:sec="3.6.7"/>).
2699   Via can be used for tracking message forwards,
2700   avoiding request loops, and identifying the protocol capabilities of
2701   senders along the request/response chain.
2703<figure><artwork type="abnf2616"><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"/>
2704  <x:ref>Via</x:ref> = 1#( <x:ref>received-protocol</x:ref> <x:ref>RWS</x:ref> <x:ref>received-by</x:ref> [ <x:ref>RWS</x:ref> <x:ref>comment</x:ref> ] )
2706  <x:ref>received-protocol</x:ref> = [ <x:ref>protocol-name</x:ref> "/" ] <x:ref>protocol-version</x:ref>
2707                      ; see <xref target="header.upgrade"/>
2708  <x:ref>received-by</x:ref>       = ( <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ] ) / <x:ref>pseudonym</x:ref>
2709  <x:ref>pseudonym</x:ref>         = <x:ref>token</x:ref>
2712   Multiple Via field values represent each proxy or gateway that has
2713   forwarded the message. Each intermediary appends its own information
2714   about how the message was received, such that the end result is ordered
2715   according to the sequence of forwarding recipients.
2718   A proxy &MUST; send an appropriate Via header field, as described below, in
2719   each message that it forwards.
2720   An HTTP-to-HTTP gateway &MUST; send an appropriate Via header field in
2721   each inbound request message and &MAY; send a Via header field in
2722   forwarded response messages.
2725   For each intermediary, the received-protocol indicates the protocol and
2726   protocol version used by the upstream sender of the message. Hence, the
2727   Via field value records the advertised protocol capabilities of the
2728   request/response chain such that they remain visible to downstream
2729   recipients; this can be useful for determining what backwards-incompatible
2730   features might be safe to use in response, or within a later request, as
2731   described in <xref target="http.version"/>. For brevity, the protocol-name
2732   is omitted when the received protocol is HTTP.
2735   The received-by portion of the field value is normally the host and optional
2736   port number of a recipient server or client that subsequently forwarded the
2737   message.
2738   However, if the real host is considered to be sensitive information, a
2739   sender &MAY; replace it with a pseudonym. If a port is not provided,
2740   a recipient &MAY; interpret that as meaning it was received on the default
2741   TCP port, if any, for the received-protocol.
2744   A sender &MAY; generate comments in the Via header field to identify the
2745   software of each recipient, analogous to the <x:ref>User-Agent</x:ref> and
2746   <x:ref>Server</x:ref> header fields. However, all comments in the Via field
2747   are optional, and a recipient &MAY; remove them prior to forwarding the
2748   message.
2751   For example, a request message could be sent from an HTTP/1.0 user
2752   agent to an internal proxy code-named "fred", which uses HTTP/1.1 to
2753   forward the request to a public proxy at, which completes
2754   the request by forwarding it to the origin server at
2755   The request received by would then have the following
2756   Via header field:
2758<figure><artwork type="example">
2759  Via: 1.0 fred, 1.1
2762   An intermediary used as a portal through a network firewall
2763   &SHOULD-NOT; forward the names and ports of hosts within the firewall
2764   region unless it is explicitly enabled to do so. If not enabled, such an
2765   intermediary &SHOULD; replace each received-by host of any host behind the
2766   firewall by an appropriate pseudonym for that host.
2769   An intermediary &MAY; combine an ordered subsequence of Via header
2770   field entries into a single such entry if the entries have identical
2771   received-protocol values. For example,
2773<figure><artwork type="example">
2774  Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy
2777  could be collapsed to
2779<figure><artwork type="example">
2780  Via: 1.0 ricky, 1.1 mertz, 1.0 lucy
2783   A sender &SHOULD-NOT; combine multiple entries unless they are all
2784   under the same organizational control and the hosts have already been
2785   replaced by pseudonyms. A sender &MUST-NOT; combine entries that
2786   have different received-protocol values.
2790<section title="Transformations" anchor="message.transformations">
2791   <iref primary="true" item="transforming proxy"/>
2792   <iref primary="true" item="non-transforming proxy"/>
2794   Some intermediaries include features for transforming messages and their
2795   payloads. A proxy might, for example, convert between image formats in
2796   order to save cache space or to reduce the amount of traffic on a slow
2797   link. However, operational problems might occur when these transformations
2798   are applied to payloads intended for critical applications, such as medical
2799   imaging or scientific data analysis, particularly when integrity checks or
2800   digital signatures are used to ensure that the payload received is
2801   identical to the original.
2804   An HTTP-to-HTTP proxy is called a "<x:dfn>transforming proxy</x:dfn>"
2805   if it is designed or configured to modify messages in a semantically
2806   meaningful way (i.e., modifications, beyond those required by normal
2807   HTTP processing, that change the message in a way that would be
2808   significant to the original sender or potentially significant to
2809   downstream recipients).  For example, a transforming proxy might be
2810   acting as a shared annotation server (modifying responses to include
2811   references to a local annotation database), a malware filter, a
2812   format transcoder, or a privacy filter. Such transformations are presumed
2813   to be desired by whichever client (or client organization) selected the
2814   proxy.
2817   If a proxy receives a request-target with a host name that is not a
2818   fully qualified domain name, it &MAY; add its own domain to the host name
2819   it received when forwarding the request.  A proxy &MUST-NOT; change the
2820   host name if the request-target contains a fully qualified domain name.
2823   A proxy &MUST-NOT; modify the "absolute-path" and "query" parts of the
2824   received request-target when forwarding it to the next inbound server,
2825   except as noted above to replace an empty path with "/" or "*".
2828   A proxy &MAY; modify the message body through application
2829   or removal of a transfer coding (<xref target="transfer.codings"/>).
2832   A proxy &MUST-NOT; transform the payload (&payload;) of a message that
2833   contains a no-transform cache-control directive (&header-cache-control;).
2836   A proxy &MAY; transform the payload of a message
2837   that does not contain a no-transform cache-control directive.
2838   A proxy that transforms a payload &MUST; add a <x:ref>Warning</x:ref>
2839   header field with the warn-code of 214 ("Transformation Applied")
2840   if one is not already in the message (see &header-warning;).
2841   A proxy that transforms the payload of a <x:ref>200 (OK)</x:ref> response
2842   can further inform downstream recipients that a transformation has been
2843   applied by changing the response status code to
2844   <x:ref>203 (Non-Authoritative Information)</x:ref> (&status-203;).
2847   A proxy &SHOULD-NOT; modify header fields that provide information about
2848   the endpoints of the communication chain, the resource state, or the
2849   selected representation (other than the payload) unless the field's
2850   definition specifically allows such modification or the modification is
2851   deemed necessary for privacy or security.
2857<section title="Connection Management" anchor="">
2859   HTTP messaging is independent of the underlying transport- or
2860   session-layer connection protocol(s).  HTTP only presumes a reliable
2861   transport with in-order delivery of requests and the corresponding
2862   in-order delivery of responses.  The mapping of HTTP request and
2863   response structures onto the data units of an underlying transport
2864   protocol is outside the scope of this specification.
2867   As described in <xref target="connecting.inbound"/>, the specific
2868   connection protocols to be used for an HTTP interaction are determined by
2869   client configuration and the <x:ref>target URI</x:ref>.
2870   For example, the "http" URI scheme
2871   (<xref target="http.uri"/>) indicates a default connection of TCP
2872   over IP, with a default TCP port of 80, but the client might be
2873   configured to use a proxy via some other connection, port, or protocol.
2876   HTTP implementations are expected to engage in connection management,
2877   which includes maintaining the state of current connections,
2878   establishing a new connection or reusing an existing connection,
2879   processing messages received on a connection, detecting connection
2880   failures, and closing each connection.
2881   Most clients maintain multiple connections in parallel, including
2882   more than one connection per server endpoint.
2883   Most servers are designed to maintain thousands of concurrent connections,
2884   while controlling request queues to enable fair use and detect
2885   denial-of-service attacks.
2888<section title="Connection" anchor="header.connection">
2889  <iref primary="true" item="Connection header field" x:for-anchor=""/>
2890  <iref primary="true" item="close" x:for-anchor=""/>
2891  <x:anchor-alias value="Connection"/>
2892  <x:anchor-alias value="connection-option"/>
2893  <x:anchor-alias value="close"/>
2895   The "Connection" header field allows the sender to indicate desired
2896   control options for the current connection.  In order to avoid confusing
2897   downstream recipients, a proxy or gateway &MUST; remove or replace any
2898   received connection options before forwarding the message.
2901   When a header field aside from Connection is used to supply control
2902   information for or about the current connection, the sender &MUST; list
2903   the corresponding field-name within the Connection header field.
2904   A proxy or gateway &MUST; parse a received Connection
2905   header field before a message is forwarded and, for each
2906   connection-option in this field, remove any header field(s) from
2907   the message with the same name as the connection-option, and then
2908   remove the Connection header field itself (or replace it with the
2909   intermediary's own connection options for the forwarded message).
2912   Hence, the Connection header field provides a declarative way of
2913   distinguishing header fields that are only intended for the
2914   immediate recipient ("hop-by-hop") from those fields that are
2915   intended for all recipients on the chain ("end-to-end"), enabling the
2916   message to be self-descriptive and allowing future connection-specific
2917   extensions to be deployed without fear that they will be blindly
2918   forwarded by older intermediaries.
2921   The Connection header field's value has the following grammar:
2923<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Connection"/><iref primary="true" item="Grammar" subitem="connection-option"/>
2924  <x:ref>Connection</x:ref>        = 1#<x:ref>connection-option</x:ref>
2925  <x:ref>connection-option</x:ref> = <x:ref>token</x:ref>
2928   Connection options are case-insensitive.
2931   A sender &MUST-NOT; send a connection option corresponding to a header
2932   field that is intended for all recipients of the payload.
2933   For example, <x:ref>Cache-Control</x:ref> is never appropriate as a
2934   connection option (&header-cache-control;).
2937   The connection options do not always correspond to a header field
2938   present in the message, since a connection-specific header field
2939   might not be needed if there are no parameters associated with a
2940   connection option. In contrast, a connection-specific header field that
2941   is received without a corresponding connection option usually indicates
2942   that the field has been improperly forwarded by an intermediary and
2943   ought to be ignored by the recipient.
2946   When defining new connection options, specification authors ought to survey
2947   existing header field names and ensure that the new connection option does
2948   not share the same name as an already deployed header field.
2949   Defining a new connection option essentially reserves that potential
2950   field-name for carrying additional information related to the
2951   connection option, since it would be unwise for senders to use
2952   that field-name for anything else.
2955   The "<x:dfn>close</x:dfn>" connection option is defined for a
2956   sender to signal that this connection will be closed after completion of
2957   the response. For example,
2959<figure><artwork type="example">
2960  Connection: close
2963   in either the request or the response header fields indicates that the
2964   sender is going to close the connection after the current request/response
2965   is complete (<xref target="persistent.tear-down"/>).
2968   A client that does not support <x:ref>persistent connections</x:ref> &MUST;
2969   send the "close" connection option in every request message.
2972   A server that does not support <x:ref>persistent connections</x:ref> &MUST;
2973   send the "close" connection option in every response message that
2974   does not have a <x:ref>1xx (Informational)</x:ref> status code.
2978<section title="Establishment" anchor="persistent.establishment">
2980   It is beyond the scope of this specification to describe how connections
2981   are established via various transport- or session-layer protocols.
2982   Each connection applies to only one transport link.
2986<section title="Persistence" anchor="persistent.connections">
2987   <x:anchor-alias value="persistent connections"/>
2989   HTTP/1.1 defaults to the use of "<x:dfn>persistent connections</x:dfn>",
2990   allowing multiple requests and responses to be carried over a single
2991   connection. The "<x:ref>close</x:ref>" connection option is used to signal
2992   that a connection will not persist after the current request/response.
2993   HTTP implementations &SHOULD; support persistent connections.
2996   A recipient determines whether a connection is persistent or not based on
2997   the most recently received message's protocol version and
2998   <x:ref>Connection</x:ref> header field (if any):
2999   <list style="symbols">
3000     <t>If the "<x:ref>close</x:ref>" connection option is present, the
3001        connection will not persist after the current response; else,</t>
3002     <t>If the received protocol is HTTP/1.1 (or later), the connection will
3003        persist after the current response; else,</t>
3004     <t>If the received protocol is HTTP/1.0, the "keep-alive"
3005        connection option is present, the recipient is not a proxy, and
3006        the recipient wishes to honor the HTTP/1.0 "keep-alive" mechanism,
3007        the connection will persist after the current response; otherwise,</t>
3008     <t>The connection will close after the current response.</t>
3009   </list>
3012   A client &MAY; send additional requests on a persistent connection until it
3013   sends or receives a "<x:ref>close</x:ref>" connection option or receives an
3014   HTTP/1.0 response without a "keep-alive" connection option.
3017   In order to remain persistent, all messages on a connection need to
3018   have a self-defined message length (i.e., one not defined by closure
3019   of the connection), as described in <xref target="message.body"/>.
3020   A server &MUST; read the entire request message body or close
3021   the connection after sending its response, since otherwise the
3022   remaining data on a persistent connection would be misinterpreted
3023   as the next request.  Likewise,
3024   a client &MUST; read the entire response message body if it intends
3025   to reuse the same connection for a subsequent request.
3028   A proxy server &MUST-NOT; maintain a persistent connection with an
3029   HTTP/1.0 client (see <xref x:sec="19.7.1" x:fmt="of" target="RFC2068"/> for
3030   information and discussion of the problems with the Keep-Alive header field
3031   implemented by many HTTP/1.0 clients).
3034   See <xref target="compatibility.with.http.1.0.persistent.connections"/>
3035   for more information on backwards compatibility with HTTP/1.0 clients.
3038<section title="Retrying Requests" anchor="persistent.retrying.requests">
3040   Connections can be closed at any time, with or without intention.
3041   Implementations ought to anticipate the need to recover
3042   from asynchronous close events.
3045   When an inbound connection is closed prematurely, a client &MAY; open a new
3046   connection and automatically retransmit an aborted sequence of requests if
3047   all of those requests have idempotent methods (&idempotent-methods;).
3048   A proxy &MUST-NOT; automatically retry non-idempotent requests.
3051   A user agent &MUST-NOT; automatically retry a request with a non-idempotent
3052   method unless it has some means to know that the request semantics are
3053   actually idempotent, regardless of the method, or some means to detect that
3054   the original request was never applied. For example, a user agent that
3055   knows (through design or configuration) that a POST request to a given
3056   resource is safe can repeat that request automatically.
3057   Likewise, a user agent designed specifically to operate on a version
3058   control repository might be able to recover from partial failure conditions
3059   by checking the target resource revision(s) after a failed connection,
3060   reverting or fixing any changes that were partially applied, and then
3061   automatically retrying the requests that failed.
3064   A client &SHOULD-NOT; automatically retry a failed automatic retry.
3068<section title="Pipelining" anchor="pipelining">
3069   <x:anchor-alias value="pipeline"/>
3071   A client that supports persistent connections &MAY; "<x:dfn>pipeline</x:dfn>"
3072   its requests (i.e., send multiple requests without waiting for each
3073   response). A server &MAY; process a sequence of pipelined requests in
3074   parallel if they all have safe methods (&safe-methods;), but it &MUST; send
3075   the corresponding responses in the same order that the requests were
3076   received.
3079   A client that pipelines requests &SHOULD; retry unanswered requests if the
3080   connection closes before it receives all of the corresponding responses.
3081   When retrying pipelined requests after a failed connection (a connection
3082   not explicitly closed by the server in its last complete response), a
3083   client &MUST-NOT; pipeline immediately after connection establishment,
3084   since the first remaining request in the prior pipeline might have caused
3085   an error response that can be lost again if multiple requests are sent on a
3086   prematurely closed connection (see the TCP reset problem described in
3087   <xref target="persistent.tear-down"/>).
3090   Idempotent methods (&idempotent-methods;) are significant to pipelining
3091   because they can be automatically retried after a connection failure.
3092   A user agent &SHOULD-NOT; pipeline requests after a non-idempotent method,
3093   until the final response status code for that method has been received,
3094   unless the user agent has a means to detect and recover from partial
3095   failure conditions involving the pipelined sequence.
3098   An intermediary that receives pipelined requests &MAY; pipeline those
3099   requests when forwarding them inbound, since it can rely on the outbound
3100   user agent(s) to determine what requests can be safely pipelined. If the
3101   inbound connection fails before receiving a response, the pipelining
3102   intermediary &MAY; attempt to retry a sequence of requests that have yet
3103   to receive a response if the requests all have idempotent methods;
3104   otherwise, the pipelining intermediary &SHOULD; forward any received
3105   responses and then close the corresponding outbound connection(s) so that
3106   the outbound user agent(s) can recover accordingly.
3111<section title="Concurrency" anchor="persistent.concurrency">
3113   A client ought to limit the number of simultaneous open
3114   connections that it maintains to a given server.
3117   Previous revisions of HTTP gave a specific number of connections as a
3118   ceiling, but this was found to be impractical for many applications. As a
3119   result, this specification does not mandate a particular maximum number of
3120   connections but, instead, encourages clients to be conservative when opening
3121   multiple connections.
3124   Multiple connections are typically used to avoid the "head-of-line
3125   blocking" problem, wherein a request that takes significant server-side
3126   processing and/or has a large payload blocks subsequent requests on the
3127   same connection. However, each connection consumes server resources.
3128   Furthermore, using multiple connections can cause undesirable side effects
3129   in congested networks.
3132   Note that a server might reject traffic that it deems abusive or
3133   characteristic of a denial-of-service attack, such as an excessive number
3134   of open connections from a single client.
3138<section title="Failures and Timeouts" anchor="persistent.failures">
3140   Servers will usually have some timeout value beyond which they will
3141   no longer maintain an inactive connection. Proxy servers might make
3142   this a higher value since it is likely that the client will be making
3143   more connections through the same proxy server. The use of persistent
3144   connections places no requirements on the length (or existence) of
3145   this timeout for either the client or the server.
3148   A client or server that wishes to time out &SHOULD; issue a graceful close
3149   on the connection. Implementations &SHOULD; constantly monitor open
3150   connections for a received closure signal and respond to it as appropriate,
3151   since prompt closure of both sides of a connection enables allocated system
3152   resources to be reclaimed.
3155   A client, server, or proxy &MAY; close the transport connection at any
3156   time. For example, a client might have started to send a new request
3157   at the same time that the server has decided to close the "idle"
3158   connection. From the server's point of view, the connection is being
3159   closed while it was idle, but from the client's point of view, a
3160   request is in progress.
3163   A server &SHOULD; sustain persistent connections, when possible, and allow
3164   the underlying transport's flow-control mechanisms to resolve temporary overloads, rather
3165   than terminate connections with the expectation that clients will retry.
3166   The latter technique can exacerbate network congestion.
3169   A client sending a message body &SHOULD; monitor
3170   the network connection for an error response while it is transmitting
3171   the request. If the client sees a response that indicates the server does
3172   not wish to receive the message body and is closing the connection, the
3173   client &SHOULD; immediately cease transmitting the body and close its side
3174   of the connection.
3178<section title="Tear-down" anchor="persistent.tear-down">
3179  <iref primary="false" item="Connection header field" x:for-anchor=""/>
3180  <iref primary="false" item="close" x:for-anchor=""/>
3182   The <x:ref>Connection</x:ref> header field
3183   (<xref target="header.connection"/>) provides a "<x:ref>close</x:ref>"
3184   connection option that a sender &SHOULD; send when it wishes to close
3185   the connection after the current request/response pair.
3188   A client that sends a "<x:ref>close</x:ref>" connection option &MUST-NOT;
3189   send further requests on that connection (after the one containing
3190   "close") and &MUST; close the connection after reading the
3191   final response message corresponding to this request.
3194   A server that receives a "<x:ref>close</x:ref>" connection option &MUST;
3195   initiate a close of the connection (see below) after it sends the
3196   final response to the request that contained "close".
3197   The server &SHOULD; send a "close" connection option
3198   in its final response on that connection. The server &MUST-NOT; process
3199   any further requests received on that connection.
3202   A server that sends a "<x:ref>close</x:ref>" connection option &MUST;
3203   initiate a close of the connection (see below) after it sends the
3204   response containing "close". The server &MUST-NOT; process
3205   any further requests received on that connection.
3208   A client that receives a "<x:ref>close</x:ref>" connection option &MUST;
3209   cease sending requests on that connection and close the connection
3210   after reading the response message containing the "close"; if additional
3211   pipelined requests had been sent on the connection, the client &SHOULD-NOT;
3212   assume that they will be processed by the server.
3215   If a server performs an immediate close of a TCP connection, there is a
3216   significant risk that the client will not be able to read the last HTTP
3217   response.  If the server receives additional data from the client on a
3218   fully closed connection, such as another request that was sent by the
3219   client before receiving the server's response, the server's TCP stack will
3220   send a reset packet to the client; unfortunately, the reset packet might
3221   erase the client's unacknowledged input buffers before they can be read
3222   and interpreted by the client's HTTP parser.
3225   To avoid the TCP reset problem, servers typically close a connection in
3226   stages. First, the server performs a half-close by closing only the write
3227   side of the read/write connection. The server then continues to read from
3228   the connection until it receives a corresponding close by the client, or
3229   until the server is reasonably certain that its own TCP stack has received
3230   the client's acknowledgement of the packet(s) containing the server's last
3231   response. Finally, the server fully closes the connection.
3234   It is unknown whether the reset problem is exclusive to TCP or might also
3235   be found in other transport connection protocols.
3239<section title="Upgrade" anchor="header.upgrade">
3240  <iref primary="true" item="Upgrade header field" x:for-anchor=""/>
3241  <x:anchor-alias value="Upgrade"/>
3242  <x:anchor-alias value="protocol"/>
3243  <x:anchor-alias value="protocol-name"/>
3244  <x:anchor-alias value="protocol-version"/>
3246   The "Upgrade" header field is intended to provide a simple mechanism
3247   for transitioning from HTTP/1.1 to some other protocol on the same
3248   connection.  A client &MAY; send a list of protocols in the Upgrade
3249   header field of a request to invite the server to switch to one or
3250   more of those protocols, in order of descending preference, before sending
3251   the final response. A server &MAY; ignore a received Upgrade header field
3252   if it wishes to continue using the current protocol on that connection.
3253   Upgrade cannot be used to insist on a protocol change.
3255<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Upgrade"/>
3256  <x:ref>Upgrade</x:ref>          = 1#<x:ref>protocol</x:ref>
3258  <x:ref>protocol</x:ref>         = <x:ref>protocol-name</x:ref> ["/" <x:ref>protocol-version</x:ref>]
3259  <x:ref>protocol-name</x:ref>    = <x:ref>token</x:ref>
3260  <x:ref>protocol-version</x:ref> = <x:ref>token</x:ref>
3263   A server that sends a <x:ref>101 (Switching Protocols)</x:ref> response
3264   &MUST; send an Upgrade header field to indicate the new protocol(s) to
3265   which the connection is being switched; if multiple protocol layers are
3266   being switched, the sender &MUST; list the protocols in layer-ascending
3267   order. A server &MUST-NOT; switch to a protocol that was not indicated by
3268   the client in the corresponding request's Upgrade header field.
3269   A server &MAY; choose to ignore the order of preference indicated by the
3270   client and select the new protocol(s) based on other factors, such as the
3271   nature of the request or the current load on the server.
3274   A server that sends a <x:ref>426 (Upgrade Required)</x:ref> response
3275   &MUST; send an Upgrade header field to indicate the acceptable protocols,
3276   in order of descending preference.
3279   A server &MAY; send an Upgrade header field in any other response to
3280   advertise that it implements support for upgrading to the listed protocols,
3281   in order of descending preference, when appropriate for a future request.
3284   The following is a hypothetical example sent by a client:
3285</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
3286GET /hello.txt HTTP/1.1
3288Connection: upgrade
3289Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
3293   The capabilities and nature of the
3294   application-level communication after the protocol change is entirely
3295   dependent upon the new protocol(s) chosen. However, immediately after
3296   sending the <x:ref>101 (Switching Protocols)</x:ref> response, the server is expected to continue responding to
3297   the original request as if it had received its equivalent within the new
3298   protocol (i.e., the server still has an outstanding request to satisfy
3299   after the protocol has been changed, and is expected to do so without
3300   requiring the request to be repeated).
3303   For example, if the Upgrade header field is received in a GET request
3304   and the server decides to switch protocols, it first responds
3305   with a <x:ref>101 (Switching Protocols)</x:ref> message in HTTP/1.1 and
3306   then immediately follows that with the new protocol's equivalent of a
3307   response to a GET on the target resource.  This allows a connection to be
3308   upgraded to protocols with the same semantics as HTTP without the
3309   latency cost of an additional round trip.  A server &MUST-NOT; switch
3310   protocols unless the received message semantics can be honored by the new
3311   protocol; an OPTIONS request can be honored by any protocol.
3314   The following is an example response to the above hypothetical request:
3315</preamble><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
3316HTTP/1.1 101 Switching Protocols
3317Connection: upgrade
3318Upgrade: HTTP/2.0
3320[... data stream switches to HTTP/2.0 with an appropriate response
3321(as defined by new protocol) to the "GET /hello.txt" request ...]
3324   When Upgrade is sent, the sender &MUST; also send a
3325   <x:ref>Connection</x:ref> header field (<xref target="header.connection"/>)
3326   that contains an "upgrade" connection option, in order to prevent Upgrade
3327   from being accidentally forwarded by intermediaries that might not implement
3328   the listed protocols.  A server &MUST; ignore an Upgrade header field that
3329   is received in an HTTP/1.0 request.
3332   A client cannot begin using an upgraded protocol on the connection until
3333   it has completely sent the request message (i.e., the client can't change
3334   the protocol it is sending in the middle of a message).
3335   If a server receives both an Upgrade and an <x:ref>Expect</x:ref> header field
3336   with the "100-continue" expectation (&header-expect;), the
3337   server &MUST; send a <x:ref>100 (Continue)</x:ref> response before sending
3338   a <x:ref>101 (Switching Protocols)</x:ref> response.
3341   The Upgrade header field only applies to switching protocols on top of the
3342   existing connection; it cannot be used to switch the underlying connection
3343   (transport) protocol, nor to switch the existing communication to a
3344   different connection. For those purposes, it is more appropriate to use a
3345   <x:ref>3xx (Redirection)</x:ref> response (&status-3xx;).
3348   This specification only defines the protocol name "HTTP" for use by
3349   the family of Hypertext Transfer Protocols, as defined by the HTTP
3350   version rules of <xref target="http.version"/> and future updates to this
3351   specification. Additional tokens ought to be registered with IANA using the
3352   registration procedure defined in <xref target="upgrade.token.registry"/>.
3357<section title="ABNF List Extension: #rule" anchor="abnf.extension">
3359   A #rule extension to the ABNF rules of <xref target="RFC5234"/> is used to
3360   improve readability in the definitions of some header field values.
3363   A construct "#" is defined, similar to "*", for defining comma-delimited
3364   lists of elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating
3365   at least &lt;n&gt; and at most &lt;m&gt; elements, each separated by a single
3366   comma (",") and optional whitespace (OWS).   
3369   In any production that uses the list construct, a sender &MUST-NOT;
3370   generate empty list elements. In other words, a sender &MUST; generate
3371   lists that satisfy the following syntax:
3372</preamble><artwork type="example">
3373  1#element =&gt; element *( OWS "," OWS element )
3376   and:
3377</preamble><artwork type="example">
3378  #element =&gt; [ 1#element ]
3381   and for n &gt;= 1 and m &gt; 1:
3382</preamble><artwork type="example">
3383  &lt;n&gt;#&lt;m&gt;element =&gt; element &lt;n-1&gt;*&lt;m-1&gt;( OWS "," OWS element )
3386   For compatibility with legacy list rules, a recipient &MUST; parse and ignore
3387   a reasonable number of empty list elements: enough to handle common mistakes
3388   by senders that merge values, but not so much that they could be used as a
3389   denial-of-service mechanism. In other words, a recipient &MUST; accept lists
3390   that satisfy the following syntax:
3392<figure><artwork type="example">
3393  #element =&gt; [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
3395  1#element =&gt; *( "," OWS ) element *( OWS "," [ OWS element ] )
3398   Empty elements do not contribute to the count of elements present.
3399   For example, given these ABNF productions:
3401<figure><artwork type="example">
3402  example-list      = 1#example-list-elmt
3403  example-list-elmt = token ; see <xref target="field.components"/>
3406   Then the following are valid values for example-list (not including the
3407   double quotes, which are present for delimitation only):
3409<figure><artwork type="example">
3410  "foo,bar"
3411  "foo ,bar,"
3412  "foo , ,bar,charlie   "
3415   In contrast, the following values would be invalid, since at least one
3416   non-empty element is required by the example-list production:
3418<figure><artwork type="example">
3419  ""
3420  ","
3421  ",   ,"
3424   <xref target="collected.abnf"/> shows the collected ABNF for recipients
3425   after the list constructs have been expanded.
3429<section title="IANA Considerations" anchor="IANA.considerations">
3431<section title="Header Field Registration" anchor="header.field.registration">
3433   HTTP header fields are registered within the "Message Headers" registry
3434   maintained at
3435   <eref target=""/>.
3438   This document defines the following HTTP header fields, so the
3439   "Permanent Message Header Field Names" registry has been updated
3440   accordingly (see <xref target="BCP90"/>).
3442<?BEGININC p1-messaging.iana-headers ?>
3443<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
3444<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
3445   <ttcol>Header Field Name</ttcol>
3446   <ttcol>Protocol</ttcol>
3447   <ttcol>Status</ttcol>
3448   <ttcol>Reference</ttcol>
3450   <c>Connection</c>
3451   <c>http</c>
3452   <c>standard</c>
3453   <c>
3454      <xref target="header.connection"/>
3455   </c>
3456   <c>Content-Length</c>
3457   <c>http</c>
3458   <c>standard</c>
3459   <c>
3460      <xref target="header.content-length"/>
3461   </c>
3462   <c>Host</c>
3463   <c>http</c>
3464   <c>standard</c>
3465   <c>
3466      <xref target=""/>
3467   </c>
3468   <c>TE</c>
3469   <c>http</c>
3470   <c>standard</c>
3471   <c>
3472      <xref target="header.te"/>
3473   </c>
3474   <c>Trailer</c>
3475   <c>http</c>
3476   <c>standard</c>
3477   <c>
3478      <xref target="header.trailer"/>
3479   </c>
3480   <c>Transfer-Encoding</c>
3481   <c>http</c>
3482   <c>standard</c>
3483   <c>
3484      <xref target="header.transfer-encoding"/>
3485   </c>
3486   <c>Upgrade</c>
3487   <c>http</c>
3488   <c>standard</c>
3489   <c>
3490      <xref target="header.upgrade"/>
3491   </c>
3492   <c>Via</c>
3493   <c>http</c>
3494   <c>standard</c>
3495   <c>
3496      <xref target="header.via"/>
3497   </c>
3500<?ENDINC p1-messaging.iana-headers ?>
3502   Furthermore, the header field-name "Close" has been registered as
3503   "reserved", since using that name as an HTTP header field might
3504   conflict with the "close" connection option of the <x:ref>Connection</x:ref>
3505   header field (<xref target="header.connection"/>).
3507<texttable align="left" suppress-title="true">
3508   <ttcol>Header Field Name</ttcol>
3509   <ttcol>Protocol</ttcol>
3510   <ttcol>Status</ttcol>
3511   <ttcol>Reference</ttcol>
3513   <c>Close</c>
3514   <c>http</c>
3515   <c>reserved</c>
3516   <c>
3517      <xref target="header.field.registration"/>
3518   </c>
3521   The change controller is: "IETF ( - Internet Engineering Task Force".
3525<section title="URI Scheme Registration" anchor="uri.scheme.registration">
3527   IANA maintains the registry of URI Schemes <xref target="BCP115"/> at
3528   <eref target=""/>.
3531   This document defines the following URI schemes, so the "Permanent URI
3532   Schemes" registry has been updated accordingly.
3534<texttable align="left" suppress-title="true">
3535   <ttcol>URI Scheme</ttcol>
3536   <ttcol>Description</ttcol>
3537   <ttcol>Reference</ttcol>
3539   <c>http</c>
3540   <c>Hypertext Transfer Protocol</c>
3541   <c><xref target="http.uri"/></c>
3543   <c>https</c>
3544   <c>Hypertext Transfer Protocol Secure</c>
3545   <c><xref target="https.uri"/></c>
3549<section title="Internet Media Type Registration" anchor="">
3551   IANA maintains the registry of Internet media types <xref target="BCP13"/> at
3552   <eref target=""/>.
3555   This document serves as the specification for the Internet media types
3556   "message/http" and "application/http". The following has been registered with
3557   IANA.
3559<section title="Internet Media Type message/http" anchor="">
3560<iref item="Media Type" subitem="message/http" primary="true"/>
3561<iref item="message/http Media Type" primary="true"/>
3563   The message/http type can be used to enclose a single HTTP request or
3564   response message, provided that it obeys the MIME restrictions for all
3565   "message" types regarding line length and encodings.
3568  <list style="hanging" x:indent="12em">
3569    <t hangText="Type name:">
3570      message
3571    </t>
3572    <t hangText="Subtype name:">
3573      http
3574    </t>
3575    <t hangText="Required parameters:">
3576      N/A
3577    </t>
3578    <t hangText="Optional parameters:">
3579      version, msgtype
3580      <list style="hanging">
3581        <t hangText="version:">
3582          The HTTP-version number of the enclosed message
3583          (e.g., "1.1"). If not present, the version can be
3584          determined from the first line of the body.
3585        </t>
3586        <t hangText="msgtype:">
3587          The message type &mdash; "request" or "response". If not
3588          present, the type can be determined from the first
3589          line of the body.
3590        </t>
3591      </list>
3592    </t>
3593    <t hangText="Encoding considerations:">
3594      only "7bit", "8bit", or "binary" are permitted
3595    </t>
3596    <t hangText="Security considerations:">
3597      see <xref target="security.considerations"/>
3598    </t>
3599    <t hangText="Interoperability considerations:">
3600      N/A
3601    </t>
3602    <t hangText="Published specification:">
3603      This specification (see <xref target=""/>).
3604    </t>
3605    <t hangText="Applications that use this media type:">
3606      N/A
3607    </t>
3608    <t hangText="Fragment identifier considerations:">
3609      N/A
3610    </t>
3611    <t hangText="Additional information:">
3612      <list style="hanging">
3613        <t hangText="Magic number(s):">N/A</t>
3614        <t hangText="Deprecated alias names for this type:">N/A</t>
3615        <t hangText="File extension(s):">N/A</t>
3616        <t hangText="Macintosh file type code(s):">N/A</t>
3617      </list>
3618    </t>
3619    <t hangText="Person and email address to contact for further information:">
3620      See&nbsp;Authors'&nbsp;Addresses Section.
3621    </t>
3622    <t hangText="Intended usage:">
3623      COMMON
3624    </t>
3625    <t hangText="Restrictions on usage:">
3626      N/A
3627    </t>
3628    <t hangText="Author:">
3629      See Authors' Addresses Section.
3630    </t>
3631    <t hangText="Change controller:">
3632      IESG
3633    </t>
3634  </list>
3637<section title="Internet Media Type application/http" anchor="">
3638<iref item="Media Type" subitem="application/http" primary="true"/>
3639<iref item="application/http Media Type" primary="true"/>
3641   The application/http type can be used to enclose a pipeline of one or more
3642   HTTP request or response messages (not intermixed).
3645  <list style="hanging" x:indent="12em">
3646    <t hangText="Type name:">
3647      application
3648    </t>
3649    <t hangText="Subtype name:">
3650      http
3651    </t>
3652    <t hangText="Required parameters:">
3653      N/A
3654    </t>
3655    <t hangText="Optional parameters:">
3656      version, msgtype
3657      <list style="hanging">
3658        <t hangText="version:">
3659          The HTTP-version number of the enclosed messages
3660          (e.g., "1.1"). If not present, the version can be
3661          determined from the first line of the body.
3662        </t>
3663        <t hangText="msgtype:">
3664          The message type &mdash; "request" or "response". If not
3665          present, the type can be determined from the first
3666          line of the body.
3667        </t>
3668      </list>
3669    </t>
3670    <t hangText="Encoding considerations:">
3671      HTTP messages enclosed by this type
3672      are in "binary" format; use of an appropriate
3673      Content-Transfer-Encoding is required when
3674      transmitted via email.
3675    </t>
3676    <t hangText="Security considerations:">
3677      see <xref target="security.considerations"/>
3678    </t>
3679    <t hangText="Interoperability considerations:">
3680      N/A
3681    </t>
3682    <t hangText="Published specification:">
3683      This specification (see <xref target=""/>).
3684    </t>
3685    <t hangText="Applications that use this media type:">
3686      N/A
3687    </t>
3688    <t hangText="Fragment identifier considerations:">
3689      N/A
3690    </t>
3691    <t hangText="Additional information:">
3692      <list style="hanging">
3693        <t hangText="Deprecated alias names for this type:">N/A</t>
3694        <t hangText="Magic number(s):">N/A</t>
3695        <t hangText="File extension(s):">N/A</t>
3696        <t hangText="Macintosh file type code(s):">N/A</t>
3697      </list>
3698    </t>
3699    <t hangText="Person and email address to contact for further information:">
3700      See&nbsp;Authors'&nbsp;Addresses Section.
3701    </t>
3702    <t hangText="Intended usage:">
3703      COMMON
3704    </t>
3705    <t hangText="Restrictions on usage:">
3706      N/A
3707    </t>
3708    <t hangText="Author:">
3709      See Authors' Addresses Section.
3710    </t>
3711    <t hangText="Change controller:">
3712      IESG
3713    </t>
3714  </list>
3719<section title="Transfer Coding Registry" anchor="transfer.coding.registry">
3721   The "HTTP Transfer Coding Registry" defines the namespace for transfer
3722   coding names. It is maintained at <eref target=""/>.
3725<section title="Procedure" anchor="transfer.coding.registry.procedure">
3727   Registrations &MUST; include the following fields:
3728   <list style="symbols">
3729     <t>Name</t>
3730     <t>Description</t>
3731     <t>Pointer to specification text</t>
3732   </list>
3735   Names of transfer codings &MUST-NOT; overlap with names of content codings
3736   (&content-codings;) unless the encoding transformation is identical, as
3737   is the case for the compression codings defined in
3738   <xref target="compression.codings"/>.
3741   Values to be added to this namespace require IETF Review (see
3742   <xref target="RFC5226" x:fmt="of" x:sec="4.1"/>), and &MUST;
3743   conform to the purpose of transfer coding defined in this specification.
3746   Use of program names for the identification of encoding formats
3747   is not desirable and is discouraged for future encodings.
3751<section title="Registration" anchor="transfer.coding.registration">
3753   The "HTTP Transfer Coding Registry" has been updated with the registrations
3754   below:
3756<texttable align="left" suppress-title="true" anchor="iana.transfer.coding.registration.table">
3757   <ttcol>Name</ttcol>
3758   <ttcol>Description</ttcol>
3759   <ttcol>Reference</ttcol>
3760   <c>chunked</c>
3761   <c>Transfer in a series of chunks</c>
3762   <c>
3763      <xref target="chunked.encoding"/>
3764   </c>
3765   <c>compress</c>
3766   <c>UNIX "compress" data format <xref target="Welch"/></c>
3767   <c>
3768      <xref target="compress.coding"/>
3769   </c>
3770   <c>deflate</c>
3771   <c>"deflate" compressed data (<xref target="RFC1951"/>) inside
3772   the "zlib" data format (<xref target="RFC1950"/>)
3773   </c>
3774   <c>
3775      <xref target="deflate.coding"/>
3776   </c>
3777   <c>gzip</c>
3778   <c>GZIP file format <xref target="RFC1952"/></c>
3779   <c>
3780      <xref target="gzip.coding"/>
3781   </c>
3782   <c>x-compress</c>
3783   <c>Deprecated (alias for compress)</c>
3784   <c>
3785      <xref target="compress.coding"/>
3786   </c>
3787   <c>x-gzip</c>
3788   <c>Deprecated (alias for gzip)</c>
3789   <c>
3790      <xref target="gzip.coding"/>
3791   </c>
3796<section title="Content Coding Registration" anchor="content.coding.registration">
3798   IANA maintains the "HTTP Content Coding Registry" at
3799   <eref target=""/>.
3802   The "HTTP Content Coding Registry" has been updated with the registrations
3803   below:
3805<texttable align="left" suppress-title="true" anchor="iana.content.coding.registration.table">
3806   <ttcol>Name</ttcol>
3807   <ttcol>Description</ttcol>
3808   <ttcol>Reference</ttcol>
3809   <c>compress</c>
3810   <c>UNIX "compress" data format <xref target="Welch"/></c>
3811   <c>
3812      <xref target="compress.coding"/>
3813   </c>
3814   <c>deflate</c>
3815   <c>"deflate" compressed data (<xref target="RFC1951"/>) inside
3816   the "zlib" data format (<xref target="RFC1950"/>)</c>
3817   <c>
3818      <xref target="deflate.coding"/>
3819   </c>
3820   <c>gzip</c>
3821   <c>GZIP file format <xref target="RFC1952"/></c>
3822   <c>
3823      <xref target="gzip.coding"/>
3824   </c>
3825   <c>x-compress</c>
3826   <c>Deprecated (alias for compress)</c>
3827   <c>
3828      <xref target="compress.coding"/>
3829   </c>
3830   <c>x-gzip</c>
3831   <c>Deprecated (alias for gzip)</c>
3832   <c>
3833      <xref target="gzip.coding"/>
3834   </c>
3838<section title="Upgrade Token Registry" anchor="upgrade.token.registry">
3840   The "Hypertext Transfer Protocol (HTTP) Upgrade Token Registry" defines the namespace for protocol-name
3841   tokens used to identify protocols in the <x:ref>Upgrade</x:ref> header
3842   field. The registry is maintained at <eref target=""/>.
3845<section title="Procedure" anchor="upgrade.token.registry.procedure">  
3847   Each registered protocol name is associated with contact information
3848   and an optional set of specifications that details how the connection
3849   will be processed after it has been upgraded.
3852   Registrations happen on a "First Come First Served" basis (see
3853   <xref target="RFC5226" x:sec="4.1" x:fmt="of"/>) and are subject to the
3854   following rules:
3855  <list style="numbers">
3856    <t>A protocol-name token, once registered, stays registered forever.</t>
3857    <t>The registration &MUST; name a responsible party for the
3858       registration.</t>
3859    <t>The registration &MUST; name a point of contact.</t>
3860    <t>The registration &MAY; name a set of specifications associated with
3861       that token. Such specifications need not be publicly available.</t>
3862    <t>The registration &SHOULD; name a set of expected "protocol-version"
3863       tokens associated with that token at the time of registration.</t>
3864    <t>The responsible party &MAY; change the registration at any time.
3865       The IANA will keep a record of all such changes, and make them
3866       available upon request.</t>
3867    <t>The IESG &MAY; reassign responsibility for a protocol token.
3868       This will normally only be used in the case when a
3869       responsible party cannot be contacted.</t>
3870  </list>
3873   This registration procedure for HTTP Upgrade Tokens replaces that
3874   previously defined in <xref target="RFC2817" x:fmt="of" x:sec="7.2"/>.
3878<section title="Upgrade Token Registration" anchor="upgrade.token.registration">
3880   The "HTTP" entry in the upgrade token registry has been updated with
3881   the registration below:
3883<texttable align="left" suppress-title="true">
3884   <ttcol>Value</ttcol>
3885   <ttcol>Description</ttcol>
3886   <ttcol>Expected Version Tokens</ttcol>
3887   <ttcol>Reference</ttcol>
3889   <c>HTTP</c>
3890   <c>Hypertext Transfer Protocol</c>
3891   <c>any DIGIT.DIGIT (e.g, "2.0")</c>
3892   <c><xref target="http.version"/></c>
3895   The responsible party is: "IETF ( - Internet Engineering Task Force".
3902<section title="Security Considerations" anchor="security.considerations">
3904   This section is meant to inform developers, information providers, and
3905   users of known security considerations relevant to HTTP message syntax,
3906   parsing, and routing. Security considerations about HTTP semantics and
3907   payloads are addressed in &semantics;.
3910<section title="Establishing Authority" anchor="establishing.authority">
3911  <iref item="authoritative response" primary="true"/>
3912  <iref item="phishing" primary="true"/>
3914   HTTP relies on the notion of an <x:dfn>authoritative response</x:dfn>: a
3915   response that has been determined by (or at the direction of) the authority
3916   identified within the target URI to be the most appropriate response for
3917   that request given the state of the target resource at the time of
3918   response message origination. Providing a response from a non-authoritative
3919   source, such as a shared cache, is often useful to improve performance and
3920   availability, but only to the extent that the source can be trusted or
3921   the distrusted response can be safely used.
3924   Unfortunately, establishing authority can be difficult.
3925   For example, <x:dfn>phishing</x:dfn> is an attack on the user's perception
3926   of authority, where that perception can be misled by presenting similar
3927   branding in hypertext, possibly aided by userinfo obfuscating the authority
3928   component (see <xref target="http.uri"/>).
3929   User agents can reduce the impact of phishing attacks by enabling users to
3930   easily inspect a target URI prior to making an action, by prominently
3931   distinguishing (or rejecting) userinfo when present, and by not sending
3932   stored credentials and cookies when the referring document is from an
3933   unknown or untrusted source.
3936   When a registered name is used in the authority component, the "http" URI
3937   scheme (<xref target="http.uri"/>) relies on the user's local name
3938   resolution service to determine where it can find authoritative responses.
3939   This means that any attack on a user's network host table, cached names, or
3940   name resolution libraries becomes an avenue for attack on establishing
3941   authority. Likewise, the user's choice of server for Domain Name Service
3942   (DNS), and the hierarchy of servers from which it obtains resolution
3943   results, could impact the authenticity of address mappings;
3944   DNS Security Extensions (DNSSEC, <xref target="RFC4033"/>) are one way to
3945   improve authenticity.
3948   Furthermore, after an IP address is obtained, establishing authority for
3949   an "http" URI is vulnerable to attacks on Internet Protocol routing.
3952   The "https" scheme (<xref target="https.uri"/>) is intended to prevent
3953   (or at least reveal) many of these potential attacks on establishing
3954   authority, provided that the negotiated TLS connection is secured and
3955   the client properly verifies that the communicating server's identity
3956   matches the target URI's authority component
3957   (see <xref target="RFC2818"/>). Correctly implementing such verification
3958   can be difficult (see <xref target="Georgiev"/>).
3962<section title="Risks of Intermediaries" anchor="risks.intermediaries">
3964   By their very nature, HTTP intermediaries are men-in-the-middle and, thus,
3965   represent an opportunity for man-in-the-middle attacks. Compromise of
3966   the systems on which the intermediaries run can result in serious security
3967   and privacy problems. Intermediaries might have access to security-related
3968   information, personal information about individual users and
3969   organizations, and proprietary information belonging to users and
3970   content providers. A compromised intermediary, or an intermediary
3971   implemented or configured without regard to security and privacy
3972   considerations, might be used in the commission of a wide range of
3973   potential attacks.
3976   Intermediaries that contain a shared cache are especially vulnerable
3977   to cache poisoning attacks, as described in &cache-poisoning;.
3980   Implementers need to consider the privacy and security
3981   implications of their design and coding decisions, and of the
3982   configuration options they provide to operators (especially the
3983   default configuration).
3986   Users need to be aware that intermediaries are no more trustworthy than
3987   the people who run them; HTTP itself cannot solve this problem.
3991<section title="Attacks via Protocol Element Length" anchor="attack.protocol.element.length">
3993   Because HTTP uses mostly textual, character-delimited fields, parsers are
3994   often vulnerable to attacks based on sending very long (or very slow)
3995   streams of data, particularly where an implementation is expecting a
3996   protocol element with no predefined length.
3999   To promote interoperability, specific recommendations are made for minimum
4000   size limits on request-line (<xref target="request.line"/>)
4001   and header fields (<xref target="header.fields"/>). These are
4002   minimum recommendations, chosen to be supportable even by implementations
4003   with limited resources; it is expected that most implementations will
4004   choose substantially higher limits.
4007   A server can reject a message that
4008   has a request-target that is too long (&status-414;) or a request payload
4009   that is too large (&status-413;). Additional status codes related to
4010   capacity limits have been defined by extensions to HTTP
4011   <xref target="RFC6585"/>.
4014   Recipients ought to carefully limit the extent to which they process other
4015   protocol elements, including (but not limited to) request methods, response
4016   status phrases, header field-names, numeric values, and body chunks.
4017   Failure to limit such processing can result in buffer overflows, arithmetic
4018   overflows, or increased vulnerability to denial-of-service attacks.
4022<section title="Response Splitting" anchor="response.splitting">
4024   Response splitting (a.k.a, CRLF injection) is a common technique, used in
4025   various attacks on Web usage, that exploits the line-based nature of HTTP
4026   message framing and the ordered association of requests to responses on
4027   persistent connections <xref target="Klein"/>. This technique can be
4028   particularly damaging when the requests pass through a shared cache.
4031   Response splitting exploits a vulnerability in servers (usually within an
4032   application server) where an attacker can send encoded data within some
4033   parameter of the request that is later decoded and echoed within any of the
4034   response header fields of the response. If the decoded data is crafted to
4035   look like the response has ended and a subsequent response has begun, the
4036   response has been split and the content within the apparent second response
4037   is controlled by the attacker. The attacker can then make any other request
4038   on the same persistent connection and trick the recipients (including
4039   intermediaries) into believing that the second half of the split is an
4040   authoritative answer to the second request.
4043   For example, a parameter within the request-target might be read by an
4044   application server and reused within a redirect, resulting in the same
4045   parameter being echoed in the <x:ref>Location</x:ref> header field of the
4046   response. If the parameter is decoded by the application and not properly
4047   encoded when placed in the response field, the attacker can send encoded
4048   CRLF octets and other content that will make the application's single
4049   response look like two or more responses.
4052   A common defense against response splitting is to filter requests for data
4053   that looks like encoded CR and LF (e.g., "%0D" and "%0A"). However, that
4054   assumes the application server is only performing URI decoding, rather
4055   than more obscure data transformations like charset transcoding, XML entity
4056   translation, base64 decoding, sprintf reformatting, etc.  A more effective
4057   mitigation is to prevent anything other than the server's core protocol
4058   libraries from sending a CR or LF within the header section, which means
4059   restricting the output of header fields to APIs that filter for bad octets
4060   and not allowing application servers to write directly to the protocol
4061   stream.
4065<section title="Request Smuggling" anchor="request.smuggling">
4067   Request smuggling (<xref target="Linhart"/>) is a technique that exploits
4068   differences in protocol parsing among various recipients to hide additional
4069   requests (which might otherwise be blocked or disabled by policy) within an
4070   apparently harmless request.  Like response splitting, request smuggling
4071   can lead to a variety of attacks on HTTP usage.
4074   This specification has introduced new requirements on request parsing,
4075   particularly with regard to message framing in
4076   <xref target="message.body.length"/>, to reduce the effectiveness of
4077   request smuggling.
4081<section title="Message Integrity" anchor="message.integrity">
4083   HTTP does not define a specific mechanism for ensuring message integrity,
4084   instead relying on the error-detection ability of underlying transport
4085   protocols and the use of length or chunk-delimited framing to detect
4086   completeness. Additional integrity mechanisms, such as hash functions or
4087   digital signatures applied to the content, can be selectively added to
4088   messages via extensible metadata header fields. Historically, the lack of
4089   a single integrity mechanism has been justified by the informal nature of
4090   most HTTP communication.  However, the prevalence of HTTP as an information
4091   access mechanism has resulted in its increasing use within environments
4092   where verification of message integrity is crucial.
4095   User agents are encouraged to implement configurable means for detecting
4096   and reporting failures of message integrity such that those means can be
4097   enabled within environments for which integrity is necessary. For example,
4098   a browser being used to view medical history or drug interaction
4099   information needs to indicate to the user when such information is detected
4100   by the protocol to be incomplete, expired, or corrupted during transfer.
4101   Such mechanisms might be selectively enabled via user agent extensions or
4102   the presence of message integrity metadata in a response.
4103   At a minimum, user agents ought to provide some indication that allows a
4104   user to distinguish between a complete and incomplete response message
4105   (<xref target="incomplete.messages"/>) when such verification is desired.
4109<section title="Message Confidentiality" anchor="message.confidentiality">
4111   HTTP relies on underlying transport protocols to provide message
4112   confidentiality when that is desired. HTTP has been specifically designed
4113   to be independent of the transport protocol, such that it can be used
4114   over many different forms of encrypted connection, with the selection of
4115   such transports being identified by the choice of URI scheme or within
4116   user agent configuration.
4119   The "https" scheme can be used to identify resources that require a
4120   confidential connection, as described in <xref target="https.uri"/>.
4124<section title="Privacy of Server Log Information" anchor="privacy.of.server.log.information">
4126   A server is in the position to save personal data about a user's requests
4127   over time, which might identify their reading patterns or subjects of
4128   interest.  In particular, log information gathered at an intermediary
4129   often contains a history of user agent interaction, across a multitude
4130   of sites, that can be traced to individual users.
4133   HTTP log information is confidential in nature; its handling is often
4134   constrained by laws and regulations.  Log information needs to be securely
4135   stored and appropriate guidelines followed for its analysis.
4136   Anonymization of personal information within individual entries helps,
4137   but it is generally not sufficient to prevent real log traces from being
4138   re-identified based on correlation with other access characteristics.
4139   As such, access traces that are keyed to a specific client are unsafe to
4140   publish even if the key is pseudonymous.
4143   To minimize the risk of theft or accidental publication, log information
4144   ought to be purged of personally identifiable information, including
4145   user identifiers, IP addresses, and user-provided query parameters,
4146   as soon as that information is no longer necessary to support operational
4147   needs for security, auditing, or fraud control.
4152<section title="Acknowledgments" anchor="acks">
4154   This edition of HTTP/1.1 builds on the many contributions that went into
4155   <xref target="RFC1945" format="none">RFC 1945</xref>,
4156   <xref target="RFC2068" format="none">RFC 2068</xref>,
4157   <xref target="RFC2145" format="none">RFC 2145</xref>, and
4158   <xref target="RFC2616" format="none">RFC 2616</xref>, including
4159   substantial contributions made by the previous authors, editors, and
4160   Working Group Chairs: Tim Berners-Lee, Ari Luotonen, Roy T. Fielding,
4161   Henrik Frystyk Nielsen, Jim Gettys, Jeffrey C. Mogul, Larry Masinter,
4162   and Paul J. Leach. Mark Nottingham oversaw this effort as Working Group Chair.
4165   Since 1999, the following contributors have helped improve the HTTP
4166   specification by reporting bugs, asking smart questions, drafting or
4167   reviewing text, and evaluating open issues:
4169<?BEGININC acks ?>
4170<t>Adam Barth,
4171Adam Roach,
4172Addison Phillips,
4173Adrian Chadd,
4174Adrian Cole,
4175Adrien W. de Croy,
4176Alan Ford,
4177Alan Ruttenberg,
4178Albert Lunde,
4179Alek Storm,
4180Alex Rousskov,
4181Alexandre Morgaut,
4182Alexey Melnikov,
4183Alisha Smith,
4184Amichai Rothman,
4185Amit Klein,
4186Amos Jeffries,
4187Andreas Maier,
4188Andreas Petersson,
4189Andrei Popov,
4190Anil Sharma,
4191Anne van Kesteren,
4192Anthony Bryan,
4193Asbjorn Ulsberg,
4194Ashok Kumar,
4195Balachander Krishnamurthy,
4196Barry Leiba,
4197Ben Laurie,
4198Benjamin Carlyle,
4199Benjamin Niven-Jenkins,
4200Benoit Claise,
4201Bil Corry,
4202Bill Burke,
4203Bjoern Hoehrmann,
4204Bob Scheifler,
4205Boris Zbarsky,
4206Brett Slatkin,
4207Brian Kell,
4208Brian McBarron,
4209Brian Pane,
4210Brian Raymor,
4211Brian Smith,
4212Bruce Perens,
4213Bryce Nesbitt,
4214Cameron Heavon-Jones,
4215Carl Kugler,
4216Carsten Bormann,
4217Charles Fry,
4218Chris Burdess,
4219Chris Newman,
4220Christian Huitema,
4221Cyrus Daboo,
4222Dale Robert Anderson,
4223Dan Wing,
4224Dan Winship,
4225Daniel Stenberg,
4226Darrel Miller,
4227Dave Cridland,
4228Dave Crocker,
4229Dave Kristol,
4230Dave Thaler,
4231David Booth,
4232David Singer,
4233David W. Morris,
4234Diwakar Shetty,
4235Dmitry Kurochkin,
4236Drummond Reed,
4237Duane Wessels,
4238Edward Lee,
4239Eitan Adler,
4240Eliot Lear,
4241Emile Stephan,
4242Eran Hammer-Lahav,
4243Eric D. Williams,
4244Eric J. Bowman,
4245Eric Lawrence,
4246Eric Rescorla,
4247Erik Aronesty,
4248EungJun Yi,
4249Evan Prodromou,
4250Felix Geisendoerfer,
4251Florian Weimer,
4252Frank Ellermann,
4253Fred Akalin,
4254Fred Bohle,
4255Frederic Kayser,
4256Gabor Molnar,
4257Gabriel Montenegro,
4258Geoffrey Sneddon,
4259Gervase Markham,
4260Gili Tzabari,
4261Grahame Grieve,
4262Greg Slepak,
4263Greg Wilkins,
4264Grzegorz Calkowski,
4265Harald Tveit Alvestrand,
4266Harry Halpin,
4267Helge Hess,
4268Henrik Nordstrom,
4269Henry S. Thompson,
4270Henry Story,
4271Herbert van de Sompel,
4272Herve Ruellan,
4273Howard Melman,
4274Hugo Haas,
4275Ian Fette,
4276Ian Hickson,
4277Ido Safruti,
4278Ilari Liusvaara,
4279Ilya Grigorik,
4280Ingo Struck,
4281J. Ross Nicoll,
4282James Cloos,
4283James H. Manger,
4284James Lacey,
4285James M. Snell,
4286Jamie Lokier,
4287Jan Algermissen,
4288Jari Arkko,
4289Jeff Hodges (who came up with the term 'effective Request-URI'),
4290Jeff Pinner,
4291Jeff Walden,
4292Jim Luther,
4293Jitu Padhye,
4294Joe D. Williams,
4295Joe Gregorio,
4296Joe Orton,
4297Joel Jaeggli,
4298John C. Klensin,
4299John C. Mallery,
4300John Cowan,
4301John Kemp,
4302John Panzer,
4303John Schneider,
4304John Stracke,
4305John Sullivan,
4306Jonas Sicking,
4307Jonathan A. Rees,
4308Jonathan Billington,
4309Jonathan Moore,
4310Jonathan Silvera,
4311Jordi Ros,
4312Joris Dobbelsteen,
4313Josh Cohen,
4314Julien Pierre,
4315Jungshik Shin,
4316Justin Chapweske,
4317Justin Erenkrantz,
4318Justin James,
4319Kalvinder Singh,
4320Karl Dubost,
4321Kathleen Moriarty,
4322Keith Hoffman,
4323Keith Moore,
4324Ken Murchison,
4325Koen Holtman,
4326Konstantin Voronkov,
4327Kris Zyp,
4328Leif Hedstrom,
4329Lionel Morand,
4330Lisa Dusseault,
4331Maciej Stachowiak,
4332Manu Sporny,
4333Marc Schneider,
4334Marc Slemko,
4335Mark Baker,
4336Mark Pauley,
4337Mark Watson,
4338Markus Isomaki,
4339Markus Lanthaler,
4340Martin J. Duerst,
4341Martin Musatov,
4342Martin Nilsson,
4343Martin Thomson,
4344Matt Lynch,
4345Matthew Cox,
4346Matthew Kerwin,
4347Max Clark,
4348Menachem Dodge,
4349Meral Shirazipour,
4350Michael Burrows,
4351Michael Hausenblas,
4352Michael Scharf,
4353Michael Sweet,
4354Michael Tuexen,
4355Michael Welzl,
4356Mike Amundsen,
4357Mike Belshe,
4358Mike Bishop,
4359Mike Kelly,
4360Mike Schinkel,
4361Miles Sabin,
4362Murray S. Kucherawy,
4363Mykyta Yevstifeyev,
4364Nathan Rixham,
4365Nicholas Shanks,
4366Nico Williams,
4367Nicolas Alvarez,
4368Nicolas Mailhot,
4369Noah Slater,
4370Osama Mazahir,
4371Pablo Castro,
4372Pat Hayes,
4373Patrick R. McManus,
4374Paul E. Jones,
4375Paul Hoffman,
4376Paul Marquess,
4377Pete Resnick,
4378Peter Lepeska,
4379Peter Occil,
4380Peter Saint-Andre,
4381Peter Watkins,
4382Phil Archer,
4383Phil Hunt,
4384Philippe Mougin,
4385Phillip Hallam-Baker,
4386Piotr Dobrogost,
4387Poul-Henning Kamp,
4388Preethi Natarajan,
4389Rajeev Bector,
4390Ray Polk,
4391Reto Bachmann-Gmuer,
4392Richard Barnes,
4393Richard Cyganiak,
4394Rob Trace,
4395Robby Simpson,
4396Robert Brewer,
4397Robert Collins,
4398Robert Mattson,
4399Robert O'Callahan,
4400Robert Olofsson,
4401Robert Sayre,
4402Robert Siemer,
4403Robert de Wilde,
4404Roberto Javier Godoy,
4405Roberto Peon,
4406Roland Zink,
4407Ronny Widjaja,
4408Ryan Hamilton,
4409S. Mike Dierken,
4410Salvatore Loreto,
4411Sam Johnston,
4412Sam Pullara,
4413Sam Ruby,
4414Saurabh Kulkarni,
4415Scott Lawrence (who maintained the original issues list),
4416Sean B. Palmer,
4417Sean Turner,
4418Sebastien Barnoud,
4419Shane McCarron,
4420Shigeki Ohtsu,
4421Simon Yarde,
4422Stefan Eissing,
4423Stefan Tilkov,
4424Stefanos Harhalakis,
4425Stephane Bortzmeyer,
4426Stephen Farrell,
4427Stephen Kent,
4428Stephen Ludin,
4429Stuart Williams,
4430Subbu Allamaraju,
4431Subramanian Moonesamy,
4432Susan Hares,
4433Sylvain Hellegouarch,
4434Tapan Divekar,
4435Tatsuhiro Tsujikawa,
4436Tatsuya Hayashi,
4437Ted Hardie,
4438Ted Lemon,
4439Thomas Broyer,
4440Thomas Fossati,
4441Thomas Maslen,
4442Thomas Nadeau,
4443Thomas Nordin,
4444Thomas Roessler,
4445Tim Bray,
4446Tim Morgan,
4447Tim Olsen,
4448Tom Zhou,
4449Travis Snoozy,
4450Tyler Close,
4451Vincent Murphy,
4452Wenbo Zhu,
4453Werner Baumann,
4454Wilbur Streett,
4455Wilfredo Sanchez Vega,
4456William A. Rowe Jr.,
4457William Chan,
4458Willy Tarreau,
4459Xiaoshu Wang,
4460Yaron Goland,
4461Yngve Nysaeter Pettersen,
4462Yoav Nir,
4463Yogesh Bang,
4464Yuchung Cheng,
4465Yutaka Oiwa,
4466Yves Lafon (long-time member of the editor team),
4467Zed A. Shaw, and
4468Zhong Yu.
4470<?ENDINC acks ?>
4472   See <xref target="RFC2616" x:fmt="of" x:sec="16"/> for additional
4473   acknowledgements from prior revisions.
4480<references title="Normative References">
4482<reference anchor="RFC7231">
4483  <front>
4484    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
4485    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4486      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4487      <address><email></email></address>
4488    </author>
4489    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4490      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4491      <address><email></email></address>
4492    </author>
4493    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4494  </front>
4495  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
4496  <x:source href="p2-semantics.xml" basename="p2-semantics">
4497    <x:defines>1xx (Informational)</x:defines>
4498    <x:defines>1xx</x:defines>
4499    <x:defines>100 (Continue)</x:defines>
4500    <x:defines>101 (Switching Protocols)</x:defines>
4501    <x:defines>2xx (Successful)</x:defines>
4502    <x:defines>2xx</x:defines>
4503    <x:defines>200 (OK)</x:defines>
4504    <x:defines>203 (Non-Authoritative Information)</x:defines>
4505    <x:defines>204 (No Content)</x:defines>
4506    <x:defines>3xx (Redirection)</x:defines>
4507    <x:defines>3xx</x:defines>
4508    <x:defines>301 (Moved Permanently)</x:defines>
4509    <x:defines>4xx (Client Error)</x:defines>
4510    <x:defines>4xx</x:defines>
4511    <x:defines>400 (Bad Request)</x:defines>
4512    <x:defines>411 (Length Required)</x:defines>
4513    <x:defines>414 (URI Too Long)</x:defines>
4514    <x:defines>417 (Expectation Failed)</x:defines>
4515    <x:defines>426 (Upgrade Required)</x:defines>
4516    <x:defines>501 (Not Implemented)</x:defines>
4517    <x:defines>502 (Bad Gateway)</x:defines>
4518    <x:defines>505 (HTTP Version Not Supported)</x:defines>
4519    <x:defines>Accept-Encoding</x:defines>
4520    <x:defines>Allow</x:defines>
4521    <x:defines>Content-Encoding</x:defines>
4522    <x:defines>Content-Location</x:defines>
4523    <x:defines>Content-Type</x:defines>
4524    <x:defines>Date</x:defines>
4525    <x:defines>Expect</x:defines>
4526    <x:defines>Location</x:defines>
4527    <x:defines>Server</x:defines>
4528    <x:defines>User-Agent</x:defines>
4529  </x:source>
4532<reference anchor="RFC7232">
4533  <front>
4534    <title>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>
4535    <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
4536      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4537      <address><email></email></address>
4538    </author>
4539    <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
4540      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4541      <address><email></email></address>
4542    </author>
4543    <date month="&ID-MONTH;" year="&ID-YEAR;" />
4544  </front>
4545  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;" />
4546  <x:source basename="p4-conditional" href="p4-conditional.xml">
4547    <x:defines>304 (Not Modified)</x:defines>
4548    <x:defines>ETag</x:defines>
4549    <x:defines>Last-Modified</x:defines>
4550  </x:source>
4553<reference anchor="RFC7233">
4554  <front>
4555    <title>Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>
4556    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4557      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4558      <address><email></email></address>
4559    </author>
4560    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
4561      <organization abbrev="W3C">World Wide Web Consortium</organization>
4562      <address><email></email></address>
4563    </author>
4564    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4565      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4566      <address><email></email></address>
4567    </author>
4568    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4569  </front>
4570  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/>
4571  <x:source href="p5-range.xml" basename="p5-range">
4572    <x:defines>Content-Range</x:defines>
4573  </x:source>
4576<reference anchor="RFC7234">
4577  <front>
4578    <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
4579    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4580      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4581      <address><email></email></address>
4582    </author>
4583    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
4584      <organization>Akamai</organization>
4585      <address><email></email></address>
4586    </author>
4587    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4588      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4589      <address><email></email></address>
4590    </author>
4591    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4592  </front>
4593  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
4594  <x:source href="p6-cache.xml" basename="p6-cache">
4595    <x:defines>Cache-Control</x:defines>
4596    <x:defines>Expires</x:defines>
4597    <x:defines>Warning</x:defines>
4598  </x:source>
4601<reference anchor="RFC7235">
4602  <front>
4603    <title>Hypertext Transfer Protocol (HTTP/1.1): Authentication</title>
4604    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4605      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4606      <address><email></email></address>
4607    </author>
4608    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4609      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4610      <address><email></email></address>
4611    </author>
4612    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4613  </front>
4614  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p7-auth-&ID-VERSION;"/>
4615  <x:source href="p7-auth.xml" basename="p7-auth">
4616    <x:defines>Proxy-Authenticate</x:defines>
4617    <x:defines>Proxy-Authorization</x:defines>
4618  </x:source>
4621<reference anchor="RFC5234">
4622  <front>
4623    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
4624    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
4625      <organization>Brandenburg InternetWorking</organization>
4626      <address>
4627        <email></email>
4628      </address> 
4629    </author>
4630    <author initials="P." surname="Overell" fullname="Paul Overell">
4631      <organization>THUS plc.</organization>
4632      <address>
4633        <email></email>
4634      </address>
4635    </author>
4636    <date month="January" year="2008"/>
4637  </front>
4638  <seriesInfo name="STD" value="68"/>
4639  <seriesInfo name="RFC" value="5234"/>
4642<reference anchor="RFC2119">
4643  <front>
4644    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
4645    <author initials="S." surname="Bradner" fullname="Scott Bradner">
4646      <organization>Harvard University</organization>
4647      <address><email></email></address>
4648    </author>
4649    <date month="March" year="1997"/>
4650  </front>
4651  <seriesInfo name="BCP" value="14"/>
4652  <seriesInfo name="RFC" value="2119"/>
4655<reference anchor="RFC3986">
4656 <front>
4657  <title abbrev='URI Generic Syntax'>Uniform Resource Identifier (URI): Generic Syntax</title>
4658  <author initials='T.' surname='Berners-Lee' fullname='Tim Berners-Lee'>
4659    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
4660    <address>
4661       <email></email>
4662       <uri></uri>
4663    </address>
4664  </author>
4665  <author initials='R.' surname='Fielding' fullname='Roy T. Fielding'>
4666    <organization abbrev="Day Software">Day Software</organization>
4667    <address>
4668      <email></email>
4669      <uri></uri>
4670    </address>
4671  </author>
4672  <author initials='L.' surname='Masinter' fullname='Larry Masinter'>
4673    <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
4674    <address>
4675      <email></email>
4676      <uri></uri>
4677    </address>
4678  </author>
4679  <date month='January' year='2005'></date>
4680 </front>
4681 <seriesInfo name="STD" value="66"/>
4682 <seriesInfo name="RFC" value="3986"/>
4685<reference anchor="RFC0793">
4686  <front>
4687    <title>Transmission Control Protocol</title>
4688    <author initials='J.' surname='Postel' fullname='Jon Postel'>
4689      <organization>University of Southern California (USC)/Information Sciences Institute</organization>
4690    </author>
4691    <date year='1981' month='September' />
4692  </front>
4693  <seriesInfo name='STD' value='7' />
4694  <seriesInfo name='RFC' value='793' />
4697<reference anchor="USASCII">
4698  <front>
4699    <title>Coded Character Set -- 7-bit American Standard Code for Information Interchange</title>
4700    <author>
4701      <organization>American National Standards Institute</organization>
4702    </author>
4703    <date year="1986"/>
4704  </front>
4705  <seriesInfo name="ANSI" value="X3.4"/>
4708<reference anchor="RFC1950">
4709  <front>
4710    <title>ZLIB Compressed Data Format Specification version 3.3</title>
4711    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4712      <organization>Aladdin Enterprises</organization>
4713      <address><email></email></address>
4714    </author>
4715    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly"/>
4716    <date month="May" year="1996"/>
4717  </front>
4718  <seriesInfo name="RFC" value="1950"/>
4719  <!--<annotation>
4720    RFC 1950 is an Informational RFC, thus it might be less stable than
4721    this specification. On the other hand, this downward reference was
4722    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4723    therefore it is unlikely to cause problems in practice. See also
4724    <xref target="BCP97"/>.
4725  </annotation>-->
4728<reference anchor="RFC1951">
4729  <front>
4730    <title>DEFLATE Compressed Data Format Specification version 1.3</title>
4731    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4732      <organization>Aladdin Enterprises</organization>
4733      <address><email></email></address>
4734    </author>
4735    <date month="May" year="1996"/>
4736  </front>
4737  <seriesInfo name="RFC" value="1951"/>
4738  <!--<annotation>
4739    RFC 1951 is an Informational RFC, thus it might be less stable than
4740    this specification. On the other hand, this downward reference was
4741    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4742    therefore it is unlikely to cause problems in practice. See also
4743    <xref target="BCP97"/>.
4744  </annotation>-->
4747<reference anchor="RFC1952">
4748  <front>
4749    <title>GZIP file format specification version 4.3</title>
4750    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4751      <organization>Aladdin Enterprises</organization>
4752      <address><email></email></address>
4753    </author>
4754    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
4755      <address><email></email></address>
4756    </author>
4757    <author initials="M." surname="Adler" fullname="Mark Adler">
4758      <address><email></email></address>
4759    </author>
4760    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4761      <address><email></email></address>
4762    </author>
4763    <author initials="G." surname="Randers-Pehrson" fullname="Glenn Randers-Pehrson">
4764      <address><email></email></address>
4765    </author>
4766    <date month="May" year="1996"/>
4767  </front>
4768  <seriesInfo name="RFC" value="1952"/>
4769  <!--<annotation>
4770    RFC 1952 is an Informational RFC, thus it might be less stable than
4771    this specification. On the other hand, this downward reference was
4772    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4773    therefore it is unlikely to cause problems in practice. See also
4774    <xref target="BCP97"/>.
4775  </annotation>-->
4778<reference anchor="Welch">
4779  <front>
4780    <title>A Technique for High-Performance Data Compression</title>
4781    <author initials="T. A." surname="Welch" fullname="Terry A. Welch"/>
4782    <date month="June" year="1984"/>
4783  </front>
4784  <seriesInfo name="IEEE Computer" value="17(6)"/>
4789<references title="Informative References">
4791<reference anchor="ISO-8859-1">
4792  <front>
4793    <title>
4794     Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1
4795    </title>
4796    <author>
4797      <organization>International Organization for Standardization</organization>
4798    </author>
4799    <date year="1998"/>
4800  </front>
4801  <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
4804<reference anchor='RFC1919'>
4805  <front>
4806    <title>Classical versus Transparent IP Proxies</title>
4807    <author initials='M.' surname='Chatel' fullname='Marc Chatel'>
4808      <address><email></email></address>
4809    </author>
4810    <date year='1996' month='March' />
4811  </front>
4812  <seriesInfo name='RFC' value='1919' />
4815<reference anchor="RFC1945">
4816  <front>
4817    <title abbrev="HTTP/1.0">Hypertext Transfer Protocol -- HTTP/1.0</title>
4818    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4819      <organization>MIT, Laboratory for Computer Science</organization>
4820      <address><email></email></address>
4821    </author>
4822    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4823      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4824      <address><email></email></address>
4825    </author>
4826    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4827      <organization>W3 Consortium, MIT Laboratory for Computer Science</organization>
4828      <address><email></email></address>
4829    </author>
4830    <date month="May" year="1996"/>
4831  </front>
4832  <seriesInfo name="RFC" value="1945"/>
4835<reference anchor="RFC2045">
4836  <front>
4837    <title abbrev="Internet Message Bodies">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
4838    <author initials="N." surname="Freed" fullname="Ned Freed">
4839      <organization>Innosoft International, Inc.</organization>
4840      <address><email></email></address>
4841    </author>
4842    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
4843      <organization>First Virtual Holdings</organization>
4844      <address><email></email></address>
4845    </author>
4846    <date month="November" year="1996"/>
4847  </front>
4848  <seriesInfo name="RFC" value="2045"/>
4851<reference anchor="RFC2047">
4852  <front>
4853    <title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title>
4854    <author initials="K." surname="Moore" fullname="Keith Moore">
4855      <organization>University of Tennessee</organization>
4856      <address><email></email></address>
4857    </author>
4858    <date month="November" year="1996"/>
4859  </front>
4860  <seriesInfo name="RFC" value="2047"/>
4863<reference anchor="RFC2068">
4864  <front>
4865    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4866    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
4867      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4868      <address><email></email></address>
4869    </author>
4870    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4871      <organization>MIT Laboratory for Computer Science</organization>
4872      <address><email></email></address>
4873    </author>
4874    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
4875      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
4876      <address><email></email></address>
4877    </author>
4878    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4879      <organization>MIT Laboratory for Computer Science</organization>
4880      <address><email></email></address>
4881    </author>
4882    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4883      <organization>MIT Laboratory for Computer Science</organization>
4884      <address><email></email></address>
4885    </author>
4886    <date month="January" year="1997"/>
4887  </front>
4888  <seriesInfo name="RFC" value="2068"/>
4891<reference anchor="RFC2145">
4892  <front>
4893    <title abbrev="HTTP Version Numbers">Use and Interpretation of HTTP Version Numbers</title>
4894    <author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul">
4895      <organization>Western Research Laboratory</organization>
4896      <address><email></email></address>
4897    </author>
4898    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4899      <organization>Department of Information and Computer Science</organization>
4900      <address><email></email></address>
4901    </author>
4902    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4903      <organization>MIT Laboratory for Computer Science</organization>
4904      <address><email></email></address>
4905    </author>
4906    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4907      <organization>W3 Consortium</organization>
4908      <address><email></email></address>
4909    </author>
4910    <date month="May" year="1997"/>
4911  </front>
4912  <seriesInfo name="RFC" value="2145"/>
4915<reference anchor="RFC2616">
4916  <front>
4917    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4918    <author initials="R." surname="Fielding" fullname="R. Fielding">
4919      <organization>University of California, Irvine</organization>
4920      <address><email></email></address>
4921    </author>
4922    <author initials="J." surname="Gettys" fullname="J. Gettys">
4923      <organization>W3C</organization>
4924      <address><email></email></address>
4925    </author>
4926    <author initials="J." surname="Mogul" fullname="J. Mogul">
4927      <organization>Compaq Computer Corporation</organization>
4928      <address><email></email></address>
4929    </author>
4930    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
4931      <organization>MIT Laboratory for Computer Science</organization>
4932      <address><email></email></address>
4933    </author>
4934    <author initials="L." surname="Masinter" fullname="L. Masinter">
4935      <organization>Xerox Corporation</organization>
4936      <address><email></email></address>
4937    </author>
4938    <author initials="P." surname="Leach" fullname="P. Leach">
4939      <organization>Microsoft Corporation</organization>
4940      <address><email></email></address>
4941    </author>
4942    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
4943      <organization>W3C</organization>
4944      <address><email></email></address>
4945    </author>
4946    <date month="June" year="1999"/>
4947  </front>
4948  <seriesInfo name="RFC" value="2616"/>
4951<reference anchor='RFC2817'>
4952  <front>
4953    <title>Upgrading to TLS Within HTTP/1.1</title>
4954    <author initials='R.' surname='Khare' fullname='R. Khare'>
4955      <organization>4K Associates / UC Irvine</organization>
4956      <address><email></email></address>
4957    </author>
4958    <author initials='S.' surname='Lawrence' fullname='S. Lawrence'>
4959      <organization>Agranat Systems, Inc.</organization>
4960      <address><email></email></address>
4961    </author>
4962    <date year='2000' month='May' />
4963  </front>
4964  <seriesInfo name='RFC' value='2817' />
4967<reference anchor='RFC2818'>
4968  <front>
4969    <title>HTTP Over TLS</title>
4970    <author initials='E.' surname='Rescorla' fullname='Eric Rescorla'>
4971      <organization>RTFM, Inc.</organization>
4972      <address><email></email></address>
4973    </author>
4974    <date year='2000' month='May' />
4975  </front>
4976  <seriesInfo name='RFC' value='2818' />
4979<reference anchor='RFC3040'>
4980  <front>
4981    <title>Internet Web Replication and Caching Taxonomy</title>
4982    <author initials='I.' surname='Cooper' fullname='I. Cooper'>
4983      <organization>Equinix, Inc.</organization>
4984    </author>
4985    <author initials='I.' surname='Melve' fullname='I. Melve'>
4986      <organization>UNINETT</organization>
4987    </author>
4988    <author initials='G.' surname='Tomlinson' fullname='G. Tomlinson'>
4989      <organization>CacheFlow Inc.</organization>
4990    </author>
4991    <date year='2001' month='January' />
4992  </front>
4993  <seriesInfo name='RFC' value='3040' />
4996<reference anchor='BCP90'>
4997  <front>
4998    <title>Registration Procedures for Message Header Fields</title>
4999    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
5000      <organization>Nine by Nine</organization>
5001      <address><email></email></address>
5002    </author>
5003    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
5004      <organization>BEA Systems</organization>
5005      <address><email></email></address>
5006    </author>
5007    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
5008      <organization>HP Labs</organization>
5009      <address><email></email></address>
5010    </author>
5011    <date year='2004' month='September' />
5012  </front>
5013  <seriesInfo name='BCP' value='90' />
5014  <seriesInfo name='RFC' value='3864' />
5017<reference anchor='RFC4033'>
5018  <front>
5019    <title>DNS Security Introduction and Requirements</title>
5020    <author initials='R.' surname='Arends' fullname='R. Arends'/>
5021    <author initials='R.' surname='Austein' fullname='R. Austein'/>
5022    <author initials='M.' surname='Larson' fullname='M. Larson'/>
5023    <author initials='D.' surname='Massey' fullname='D. Massey'/>
5024    <author initials='S.' surname='Rose' fullname='S. Rose'/>
5025    <date year='2005' month='March' />
5026  </front>
5027  <seriesInfo name='RFC' value='4033' />
5030<reference anchor="BCP13">
5031  <front>
5032    <title>Media Type Specifications and Registration Procedures</title>
5033    <author initials="N." surname="Freed" fullname="Ned Freed">
5034      <organization>Oracle</organization>
5035      <address>
5036        <email></email>
5037      </address>
5038    </author>
5039    <author initials="J." surname="Klensin" fullname="John C. Klensin">
5040      <address>
5041        <email></email>
5042      </address>
5043    </author>
5044    <author initials="T." surname="Hansen" fullname="Tony Hansen">
5045      <organization>AT&amp;T Laboratories</organization>
5046      <address>
5047        <email></email>
5048      </address>
5049    </author>
5050    <date year="2013" month="January"/>
5051  </front>
5052  <seriesInfo name="BCP" value="13"/>
5053  <seriesInfo name="RFC" value="6838"/>
5056<reference anchor='BCP115'>
5057  <front>
5058    <title>Guidelines and Registration Procedures for New URI Schemes</title>
5059    <author initials='T.' surname='Hansen' fullname='T. Hansen'>
5060      <organization>AT&amp;T Laboratories</organization>
5061      <address>
5062        <email></email>
5063      </address>
5064    </author>
5065    <author initials='T.' surname='Hardie' fullname='T. Hardie'>
5066      <organization>Qualcomm, Inc.</organization>
5067      <address>
5068        <email></email>
5069      </address>
5070    </author>
5071    <author initials='L.' surname='Masinter' fullname='L. Masinter'>
5072      <organization>Adobe Systems</organization>
5073      <address>
5074        <email></email>
5075      </address>
5076    </author>
5077    <date year='2006' month='February' />
5078  </front>
5079  <seriesInfo name='BCP' value='115' />
5080  <seriesInfo name='RFC' value='4395' />
5083<reference anchor='RFC4559'>
5084  <front>
5085    <title>SPNEGO-based Kerberos and NTLM HTTP Authentication in Microsoft Windows</title>
5086    <author initials='K.' surname='Jaganathan' fullname='K. Jaganathan'/>
5087    <author initials='L.' surname='Zhu' fullname='L. Zhu'/>
5088    <author initials='J.' surname='Brezak' fullname='J. Brezak'/>
5089    <date year='2006' month='June' />
5090  </front>
5091  <seriesInfo name='RFC' value='4559' />
5094<reference anchor='RFC5226'>
5095  <front>
5096    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
5097    <author initials='T.' surname='Narten' fullname='T. Narten'>
5098      <organization>IBM</organization>
5099      <address><email></email></address>
5100    </author>
5101    <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'>
5102      <organization>Google</organization>
5103      <address><email></email></address>
5104    </author>
5105    <date year='2008' month='May' />
5106  </front>
5107  <seriesInfo name='BCP' value='26' />
5108  <seriesInfo name='RFC' value='5226' />
5111<reference anchor='RFC5246'>
5112   <front>
5113      <title>The Transport Layer Security (TLS) Protocol Version 1.2</title>
5114      <author initials='T.' surname='Dierks' fullname='T. Dierks'/>
5115      <author initials='E.' surname='Rescorla' fullname='E. Rescorla'>
5116         <organization>RTFM, Inc.</organization>
5117      </author>
5118      <date year='2008' month='August' />
5119   </front>
5120   <seriesInfo name='RFC' value='5246' />
5123<reference anchor="RFC5322">
5124  <front>
5125    <title>Internet Message Format</title>
5126    <author initials="P." surname="Resnick" fullname="P. Resnick">
5127      <organization>Qualcomm Incorporated</organization>
5128    </author>
5129    <date year="2008" month="October"/>
5130  </front>
5131  <seriesInfo name="RFC" value="5322"/>
5134<reference anchor="RFC6265">
5135  <front>
5136    <title>HTTP State Management Mechanism</title>
5137    <author initials="A." surname="Barth" fullname="Adam Barth">
5138      <organization abbrev="U.C. Berkeley">
5139        University of California, Berkeley
5140      </organization>
5141      <address><email></email></address>
5142    </author>
5143    <date year="2011" month="April" />
5144  </front>
5145  <seriesInfo name="RFC" value="6265"/>
5148<reference anchor='RFC6585'>
5149  <front>
5150    <title>Additional HTTP Status Codes</title>
5151    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
5152      <organization>Rackspace</organization>
5153    </author>
5154    <author initials='R.' surname='Fielding' fullname='R. Fielding'>
5155      <organization>Adobe</organization>
5156    </author>
5157    <date year='2012' month='April' />
5158   </front>
5159   <seriesInfo name='RFC' value='6585' />
5162<!--<reference anchor='BCP97'>
5163  <front>
5164    <title>Handling Normative References to Standards-Track Documents</title>
5165    <author initials='J.' surname='Klensin' fullname='J. Klensin'>
5166      <address>
5167        <email></email>
5168      </address>
5169    </author>
5170    <author initials='S.' surname='Hartman' fullname='S. Hartman'>
5171      <organization>MIT</organization>
5172      <address>
5173        <email></email>
5174      </address>
5175    </author>
5176    <date year='2007' month='June' />
5177  </front>
5178  <seriesInfo name='BCP' value='97' />
5179  <seriesInfo name='RFC' value='4897' />
5182<reference anchor="Kri2001" target="">
5183  <front>
5184    <title>HTTP Cookies: Standards, Privacy, and Politics</title>
5185    <author initials="D." surname="Kristol" fullname="David M. Kristol"/>
5186    <date year="2001" month="November"/>
5187  </front>
5188  <seriesInfo name="ACM Transactions on Internet Technology" value="1(2)"/>
5191<reference anchor="Klein" target="">
5192  <front>
5193    <title>Divide and Conquer - HTTP Response Splitting, Web Cache Poisoning Attacks, and Related Topics</title>
5194    <author initials="A." surname="Klein" fullname="Amit Klein">
5195      <organization>Sanctum, Inc.</organization>
5196    </author>
5197    <date year="2004" month="March"/>
5198  </front>
5201<reference anchor="Georgiev" target="">
5202  <front>
5203    <title>The Most Dangerous Code in the World: Validating SSL Certificates in Non-browser Software</title>
5204    <author initials="M." surname="Georgiev" fullname="Martin Georgiev"/>
5205    <author initials="S." surname="Iyengar" fullname="Subodh Iyengar"/>
5206    <author initials="S." surname="Jana" fullname="Suman Jana"/>
5207    <author initials="R." surname="Anubhai" fullname="Rishita Anubhai"/>
5208    <author initials="D." surname="Boneh" fullname="Dan Boneh"/>
5209    <author initials="V." surname="Shmatikov" fullname="Vitaly Shmatikov"/>
5210    <date year="2012" month="October"/>
5211  </front>
5212  <x:prose>In Proceedings of the 2012 ACM Conference on Computer and Communications Security (CCS '12), pp. 38-49</x:prose>
5215<reference anchor="Linhart" target="">
5216  <front>
5217    <title>HTTP Request Smuggling</title>
5218    <author initials="C." surname="Linhart" fullname="Chaim Linhart"/>
5219    <author initials="A." surname="Klein" fullname="Amit Klein"/>
5220    <author initials="R." surname="Heled" fullname="Ronen Heled"/>
5221    <author initials="S." surname="Orrin" fullname="Steve Orrin"/>
5222    <date year="2005" month="June"/>
5223  </front>
5229<section title="HTTP Version History" anchor="compatibility">
5231   HTTP has been in use since 1990. The first version, later referred to as
5232   HTTP/0.9, was a simple protocol for hypertext data transfer across the
5233   Internet, using only a single request method (GET) and no metadata.
5234   HTTP/1.0, as defined by <xref target="RFC1945"/>, added a range of request
5235   methods and MIME-like messaging, allowing for metadata to be transferred
5236   and modifiers placed on the request/response semantics. However,
5237   HTTP/1.0 did not sufficiently take into consideration the effects of
5238   hierarchical proxies, caching, the need for persistent connections, or
5239   name-based virtual hosts. The proliferation of incompletely implemented
5240   applications calling themselves "HTTP/1.0" further necessitated a
5241   protocol version change in order for two communicating applications
5242   to determine each other's true capabilities.
5245   HTTP/1.1 remains compatible with HTTP/1.0 by including more stringent
5246   requirements that enable reliable implementations, adding only
5247   those features that can either be safely ignored by an HTTP/1.0
5248   recipient or only be sent when communicating with a party advertising
5249   conformance with HTTP/1.1.
5252   HTTP/1.1 has been designed to make supporting previous versions easy.
5253   A general-purpose HTTP/1.1 server ought to be able to understand any valid
5254   request in the format of HTTP/1.0, responding appropriately with an
5255   HTTP/1.1 message that only uses features understood (or safely ignored) by
5256   HTTP/1.0 clients. Likewise, an HTTP/1.1 client can be expected to
5257   understand any valid HTTP/1.0 response.
5260   Since HTTP/0.9 did not support header fields in a request, there is no
5261   mechanism for it to support name-based virtual hosts (selection of resource
5262   by inspection of the <x:ref>Host</x:ref> header field).
5263   Any server that implements name-based virtual hosts ought to disable
5264   support for HTTP/0.9. Most requests that appear to be HTTP/0.9 are, in
5265   fact, badly constructed HTTP/1.x requests caused by a client failing to
5266   properly encode the request-target.
5269<section title="Changes from HTTP/1.0" anchor="changes.from.1.0">
5271   This section summarizes major differences between versions HTTP/1.0
5272   and HTTP/1.1.
5275<section title="Multihomed Web Servers" anchor="">
5277   The requirements that clients and servers support the <x:ref>Host</x:ref>
5278   header field (<xref target=""/>), report an error if it is
5279   missing from an HTTP/1.1 request, and accept absolute URIs (<xref target="request-target"/>)
5280   are among the most important changes defined by HTTP/1.1.
5283   Older HTTP/1.0 clients assumed a one-to-one relationship of IP
5284   addresses and servers; there was no other established mechanism for
5285   distinguishing the intended server of a request than the IP address
5286   to which that request was directed. The <x:ref>Host</x:ref> header field was
5287   introduced during the development of HTTP/1.1 and, though it was
5288   quickly implemented by most HTTP/1.0 browsers, additional requirements
5289   were placed on all HTTP/1.1 requests in order to ensure complete
5290   adoption.  At the time of this writing, most HTTP-based services
5291   are dependent upon the Host header field for targeting requests.
5295<section title="Keep-Alive Connections" anchor="compatibility.with.http.1.0.persistent.connections">
5297   In HTTP/1.0, each connection is established by the client prior to the
5298   request and closed by the server after sending the response. However, some
5299   implementations implement the explicitly negotiated ("Keep-Alive") version
5300   of persistent connections described in <xref x:sec="19.7.1" x:fmt="of"
5301   target="RFC2068"/>.
5304   Some clients and servers might wish to be compatible with these previous
5305   approaches to persistent connections, by explicitly negotiating for them
5306   with a "Connection: keep-alive" request header field. However, some
5307   experimental implementations of HTTP/1.0 persistent connections are faulty;
5308   for example, if an HTTP/1.0 proxy server doesn't understand
5309   <x:ref>Connection</x:ref>, it will erroneously forward that header field
5310   to the next inbound server, which would result in a hung connection.
5313   One attempted solution was the introduction of a Proxy-Connection header
5314   field, targeted specifically at proxies. In practice, this was also
5315   unworkable, because proxies are often deployed in multiple layers, bringing
5316   about the same problem discussed above.
5319   As a result, clients are encouraged not to send the Proxy-Connection header
5320   field in any requests.
5323   Clients are also encouraged to consider the use of Connection: keep-alive
5324   in requests carefully; while they can enable persistent connections with
5325   HTTP/1.0 servers, clients using them will need to monitor the
5326   connection for "hung" requests (which indicate that the client ought stop
5327   sending the header field), and this mechanism ought not be used by clients
5328   at all when a proxy is being used.
5332<section title="Introduction of Transfer-Encoding" anchor="introduction.of.transfer-encoding">
5334   HTTP/1.1 introduces the <x:ref>Transfer-Encoding</x:ref> header field
5335   (<xref target="header.transfer-encoding"/>).
5336   Transfer codings need to be decoded prior to forwarding an HTTP message
5337   over a MIME-compliant protocol.
5343<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
5345  HTTP's approach to error handling has been explained.
5346  (<xref target="conformance" />)
5349  The HTTP-version ABNF production has been clarified to be case-sensitive.
5350  Additionally, version numbers have been restricted to single digits, due
5351  to the fact that implementations are known to handle multi-digit version
5352  numbers incorrectly.
5353  (<xref target="http.version"/>)
5356  Userinfo (i.e., username and password) are now disallowed in HTTP and
5357  HTTPS URIs, because of security issues related to their transmission on the
5358  wire.
5359  (<xref target="http.uri" />)
5362  The HTTPS URI scheme is now defined by this specification; previously,
5363  it was done in  <xref target="RFC2818" x:fmt="of" x:sec="2.4"/>.
5364  Furthermore, it implies end-to-end security.
5365  (<xref target="https.uri"/>)
5368  HTTP messages can be (and often are) buffered by implementations; despite
5369  it sometimes being available as a stream, HTTP is fundamentally a
5370  message-oriented protocol.
5371  Minimum supported sizes for various protocol elements have been
5372  suggested, to improve interoperability.
5373  (<xref target="http.message" />)
5376  Invalid whitespace around field-names is now required to be rejected,
5377  because accepting it represents a security vulnerability.
5378  The ABNF productions defining header fields now only list the field value.
5379  (<xref target="header.fields"/>)
5382  Rules about implicit linear whitespace between certain grammar productions
5383  have been removed; now whitespace is only allowed where specifically
5384  defined in the ABNF.
5385  (<xref target="whitespace"/>)
5388  Header fields that span multiple lines ("line folding") are deprecated.
5389  (<xref target="field.parsing" />)
5392  The NUL octet is no longer allowed in comment and quoted-string text, and
5393  handling of backslash-escaping in them has been clarified.
5394  The quoted-pair rule no longer allows escaping control characters other than
5395  HTAB.
5396  Non-US-ASCII content in header fields and the reason phrase has been obsoleted
5397  and made opaque (the TEXT rule was removed).
5398  (<xref target="field.components"/>)
5401  Bogus <x:ref>Content-Length</x:ref> header fields are now required to be
5402  handled as errors by recipients.
5403  (<xref target="header.content-length"/>)
5406  The algorithm for determining the message body length has been clarified
5407  to indicate all of the special cases (e.g., driven by methods or status
5408  codes) that affect it, and that new protocol elements cannot define such
5409  special cases.
5410  CONNECT is a new, special case in determining message body length.
5411  "multipart/byteranges" is no longer a way of determining message body length
5412  detection.
5413  (<xref target="message.body.length"/>)
5416  The "identity" transfer coding token has been removed.
5417  (Sections <xref format="counter" target="message.body"/> and
5418  <xref format="counter" target="transfer.codings"/>)
5421  Chunk length does not include the count of the octets in the
5422  chunk header and trailer.
5423  Line folding in chunk extensions is  disallowed.
5424  (<xref target="chunked.encoding"/>)
5427  The meaning of the "deflate" content coding has been clarified.
5428  (<xref target="deflate.coding" />)
5431  The segment + query components of RFC 3986 have been used to define the
5432  request-target, instead of abs_path from RFC 1808.
5433  The asterisk-form of the request-target is only allowed with the OPTIONS
5434  method.
5435  (<xref target="request-target"/>)
5438  The term "Effective Request URI" has been introduced.
5439  (<xref target="effective.request.uri" />)
5442  Gateways do not need to generate <x:ref>Via</x:ref> header fields anymore.
5443  (<xref target="header.via"/>)
5446  Exactly when "close" connection options have to be sent has been clarified.
5447  Also, "hop-by-hop" header fields are required to appear in the Connection header
5448  field; just because they're defined as hop-by-hop in this specification
5449  doesn't exempt them.
5450  (<xref target="header.connection"/>)
5453  The limit of two connections per server has been removed.
5454  An idempotent sequence of requests is no longer required to be retried.
5455  The requirement to retry requests under certain circumstances when the
5456  server prematurely closes the connection has been removed.
5457  Also, some extraneous requirements about when servers are allowed to close
5458  connections prematurely have been removed.
5459  (<xref target="persistent.connections"/>)
5462  The semantics of the <x:ref>Upgrade</x:ref> header field is now defined in
5463  responses other than 101 (this was incorporated from <xref
5464  target="RFC2817"/>). Furthermore, the ordering in the field value is now
5465  significant.
5466  (<xref target="header.upgrade"/>)
5469  Empty list elements in list productions (e.g., a list header field containing
5470  ", ,") have been deprecated.
5471  (<xref target="abnf.extension"/>)
5474  Registration of Transfer Codings now requires IETF Review
5475  (<xref target="transfer.coding.registry"/>)
5478  This specification now defines the Upgrade Token Registry, previously
5479  defined in <xref target="RFC2817" x:fmt="of" x:sec="7.2"/>.
5480  (<xref target="upgrade.token.registry"/>)
5483  The expectation to support HTTP/0.9 requests has been removed.
5484  (<xref target="compatibility"/>)
5487  Issues with the Keep-Alive and Proxy-Connection header fields in requests
5488  are pointed out, with use of the latter being discouraged altogether.
5489  (<xref target="compatibility.with.http.1.0.persistent.connections" />)
5494<?BEGININC p1-messaging.abnf-appendix ?>
5495<section xmlns:x="" title="Collected ABNF" anchor="collected.abnf">
5497<artwork type="abnf" name="p1-messaging.parsed-abnf">
5498<x:ref>BWS</x:ref> = OWS
5500<x:ref>Connection</x:ref> = *( "," OWS ) connection-option *( OWS "," [ OWS
5501 connection-option ] )
5502<x:ref>Content-Length</x:ref> = 1*DIGIT
5504<x:ref>HTTP-message</x:ref> = start-line *( header-field CRLF ) CRLF [ message-body
5505 ]
5506<x:ref>HTTP-name</x:ref> = %x48.54.54.50 ; HTTP
5507<x:ref>HTTP-version</x:ref> = HTTP-name "/" DIGIT "." DIGIT
5508<x:ref>Host</x:ref> = uri-host [ ":" port ]
5510<x:ref>OWS</x:ref> = *( SP / HTAB )
5512<x:ref>RWS</x:ref> = 1*( SP / HTAB )
5514<x:ref>TE</x:ref> = [ ( "," / t-codings ) *( OWS "," [ OWS t-codings ] ) ]
5515<x:ref>Trailer</x:ref> = *( "," OWS ) field-name *( OWS "," [ OWS field-name ] )
5516<x:ref>Transfer-Encoding</x:ref> = *( "," OWS ) transfer-coding *( OWS "," [ OWS
5517 transfer-coding ] )
5519<x:ref>URI-reference</x:ref> = &lt;URI-reference, see [RFC3986], Section 4.1&gt;
5520<x:ref>Upgrade</x:ref> = *( "," OWS ) protocol *( OWS "," [ OWS protocol ] )
5522<x:ref>Via</x:ref> = *( "," OWS ) ( received-protocol RWS received-by [ RWS comment
5523 ] ) *( OWS "," [ OWS ( received-protocol RWS received-by [ RWS
5524 comment ] ) ] )
5526<x:ref>absolute-URI</x:ref> = &lt;absolute-URI, see [RFC3986], Section 4.3&gt;
5527<x:ref>absolute-form</x:ref> = absolute-URI
5528<x:ref>absolute-path</x:ref> = 1*( "/" segment )
5529<x:ref>asterisk-form</x:ref> = "*"
5530<x:ref>authority</x:ref> = &lt;authority, see [RFC3986], Section 3.2&gt;
5531<x:ref>authority-form</x:ref> = authority
5533<x:ref>chunk</x:ref> = chunk-size [ chunk-ext ] CRLF chunk-data CRLF
5534<x:ref>chunk-data</x:ref> = 1*OCTET
5535<x:ref>chunk-ext</x:ref> = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
5536<x:ref>chunk-ext-name</x:ref> = token
5537<x:ref>chunk-ext-val</x:ref> = token / quoted-string
5538<x:ref>chunk-size</x:ref> = 1*HEXDIG
5539<x:ref>chunked-body</x:ref> = *chunk last-chunk trailer-part CRLF
5540<x:ref>comment</x:ref> = "(" *( ctext / quoted-pair / comment ) ")"
5541<x:ref>connection-option</x:ref> = token
5542<x:ref>ctext</x:ref> = HTAB / SP / %x21-27 ; '!'-'''
5543 / %x2A-5B ; '*'-'['
5544 / %x5D-7E ; ']'-'~'
5545 / obs-text
5547<x:ref>field-content</x:ref> = field-vchar [ 1*( SP / HTAB ) field-vchar ]
5548<x:ref>field-name</x:ref> = token
5549<x:ref>field-value</x:ref> = *( field-content / obs-fold )
5550<x:ref>field-vchar</x:ref> = VCHAR / obs-text
5551<x:ref>fragment</x:ref> = &lt;fragment, see [RFC3986], Section 3.5&gt;
5553<x:ref>header-field</x:ref> = field-name ":" OWS field-value OWS
5554<x:ref>http-URI</x:ref> = "http://" authority path-abempty [ "?" query ] [ "#"
5555 fragment ]
5556<x:ref>https-URI</x:ref> = "https://" authority path-abempty [ "?" query ] [ "#"
5557 fragment ]
5559<x:ref>last-chunk</x:ref> = 1*"0" [ chunk-ext ] CRLF
5561<x:ref>message-body</x:ref> = *OCTET
5562<x:ref>method</x:ref> = token
5564<x:ref>obs-fold</x:ref> = CRLF 1*( SP / HTAB )
5565<x:ref>obs-text</x:ref> = %x80-FF
5566<x:ref>origin-form</x:ref> = absolute-path [ "?" query ]
5568<x:ref>partial-URI</x:ref> = relative-part [ "?" query ]
5569<x:ref>path-abempty</x:ref> = &lt;path-abempty, see [RFC3986], Section 3.3&gt;
5570<x:ref>port</x:ref> = &lt;port, see [RFC3986], Section 3.2.3&gt;
5571<x:ref>protocol</x:ref> = protocol-name [ "/" protocol-version ]
5572<x:ref>protocol-name</x:ref> = token
5573<x:ref>protocol-version</x:ref> = token
5574<x:ref>pseudonym</x:ref> = token
5576<x:ref>qdtext</x:ref> = HTAB / SP / "!" / %x23-5B ; '#'-'['
5577 / %x5D-7E ; ']'-'~'
5578 / obs-text
5579<x:ref>query</x:ref> = &lt;query, see [RFC3986], Section 3.4&gt;
5580<x:ref>quoted-pair</x:ref> = "\" ( HTAB / SP / VCHAR / obs-text )
5581<x:ref>quoted-string</x:ref> = DQUOTE *( qdtext / quoted-pair ) DQUOTE
5583<x:ref>rank</x:ref> = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] )
5584<x:ref>reason-phrase</x:ref> = *( HTAB / SP / VCHAR / obs-text )
5585<x:ref>received-by</x:ref> = ( uri-host [ ":" port ] ) / pseudonym
5586<x:ref>received-protocol</x:ref> = [ protocol-name "/" ] protocol-version
5587<x:ref>relative-part</x:ref> = &lt;relative-part, see [RFC3986], Section 4.2&gt;
5588<x:ref>request-line</x:ref> = method SP request-target SP HTTP-version CRLF
5589<x:ref>request-target</x:ref> = origin-form / absolute-form / authority-form /
5590 asterisk-form
5592<x:ref>scheme</x:ref> = &lt;scheme, see [RFC3986], Section 3.1&gt;
5593<x:ref>segment</x:ref> = &lt;segment, see [RFC3986], Section 3.3&gt;
5594<x:ref>start-line</x:ref> = request-line / status-line
5595<x:ref>status-code</x:ref> = 3DIGIT
5596<x:ref>status-line</x:ref> = HTTP-version SP status-code SP reason-phrase CRLF
5598<x:ref>t-codings</x:ref> = "trailers" / ( transfer-coding [ t-ranking ] )
5599<x:ref>t-ranking</x:ref> = OWS ";" OWS "q=" rank
5600<x:ref>tchar</x:ref> = "!" / "#" / "$" / "%" / "&amp;" / "'" / "*" / "+" / "-" / "." /
5601 "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
5602<x:ref>token</x:ref> = 1*tchar
5603<x:ref>trailer-part</x:ref> = *( header-field CRLF )
5604<x:ref>transfer-coding</x:ref> = "chunked" / "compress" / "deflate" / "gzip" /
5605 transfer-extension
5606<x:ref>transfer-extension</x:ref> = token *( OWS ";" OWS transfer-parameter )
5607<x:ref>transfer-parameter</x:ref> = token BWS "=" BWS ( token / quoted-string )
5609<x:ref>uri-host</x:ref> = &lt;host, see [RFC3986], Section 3.2.2&gt;
5613<?ENDINC p1-messaging.abnf-appendix ?>
Note: See TracBrowser for help on using the repository browser.