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

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

"Author's Addresses Section" (#553)

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 244.7 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 Note "<x:h xmlns:x=''>Note:</x:h>">
19  <!ENTITY caching-overview       "<xref target='RFC7234' x:rel='#caching.overview' xmlns:x=''/>">
20  <!ENTITY cache-incomplete       "<xref target='RFC7234' x:rel='#response.cacheability' xmlns:x=''/>">
21  <!ENTITY cache-poisoning        "<xref target='RFC7234' x:rel='#security.considerations' xmlns:x=''/>">
22  <!ENTITY payload                "<xref target='RFC7231' x:rel='#payload' xmlns:x=''/>">
23  <!ENTITY media-type             "<xref target='RFC7231' x:rel='#media.type' xmlns:x=''/>">
24  <!ENTITY content-codings        "<xref target='RFC7231' x:rel='#content.codings' xmlns:x=''/>">
25  <!ENTITY CONNECT                "<xref target='RFC7231' x:rel='#CONNECT' xmlns:x=''/>">
26  <!ENTITY content.negotiation    "<xref target='RFC7231' x:rel='#content.negotiation' xmlns:x=''/>">
27  <!ENTITY diff-mime              "<xref target='RFC7231' x:rel='#differences.between.http.and.mime' xmlns:x=''/>">
28  <!ENTITY representation         "<xref target='RFC7231' x:rel='#representations' xmlns:x=''/>">
29  <!ENTITY GET                    "<xref target='RFC7231' x:rel='#GET' xmlns:x=''/>">
30  <!ENTITY HEAD                   "<xref target='RFC7231' x:rel='#HEAD' xmlns:x=''/>">
31  <!ENTITY header-allow           "<xref target='RFC7231' x:rel='#header.allow' xmlns:x=''/>">
32  <!ENTITY header-cache-control   "<xref target='RFC7234' x:rel='#header.cache-control' xmlns:x=''/>">
33  <!ENTITY header-content-encoding    "<xref target='RFC7231' x:rel='#header.content-encoding' xmlns:x=''/>">
34  <!ENTITY header-content-location    "<xref target='RFC7231' x:rel='#header.content-location' xmlns:x=''/>">
35  <!ENTITY header-content-range   "<xref target='RFC7233' x:rel='#header.content-range' xmlns:x=''/>">
36  <!ENTITY header-content-type    "<xref target='RFC7231' x:rel='#header.content-type' xmlns:x=''/>">
37  <!ENTITY header-date            "<xref target='RFC7231' x:rel='' xmlns:x=''/>">
38  <!ENTITY header-etag            "<xref target='RFC7232' x:rel='#header.etag' xmlns:x=''/>">
39  <!ENTITY header-expect          "<xref target='RFC7231' x:rel='#header.expect' xmlns:x=''/>">
40  <!ENTITY header-expires         "<xref target='RFC7234' x:rel='#header.expires' xmlns:x=''/>">
41  <!ENTITY header-last-modified   "<xref target='RFC7232' x:rel='#header.last-modified' xmlns:x=''/>">
42  <!ENTITY header-mime-version    "<xref target='RFC7231' x:rel='#mime-version' xmlns:x=''/>">
43  <!ENTITY header-pragma          "<xref target='RFC7234' x:rel='#header.pragma' xmlns:x=''/>">
44  <!ENTITY header-proxy-authenticate  "<xref target='RFC7235' x:rel='#header.proxy-authenticate' xmlns:x=''/>">
45  <!ENTITY header-proxy-authorization "<xref target='RFC7235' x:rel='#header.proxy-authorization' xmlns:x=''/>">
46  <!ENTITY header-server          "<xref target='RFC7231' x:rel='#header.server' xmlns:x=''/>">
47  <!ENTITY header-warning         "<xref target='RFC7234' x:rel='#header.warning' xmlns:x=''/>">
48  <!ENTITY idempotent-methods     "<xref target='RFC7231' x:rel='#idempotent.methods' xmlns:x=''/>">
49  <!ENTITY safe-methods           "<xref target='RFC7231' x:rel='#safe.methods' xmlns:x=''/>">
50  <!ENTITY methods                "<xref target='RFC7231' x:rel='#methods' xmlns:x=''/>">
51  <!ENTITY OPTIONS                "<xref target='RFC7231' x:rel='#OPTIONS' xmlns:x=''/>">
52  <!ENTITY qvalue                 "<xref target='RFC7231' x:rel='#quality.values' xmlns:x=''/>">
53  <!ENTITY request-header-fields  "<xref target='RFC7231' x:rel='#request.header.fields' xmlns:x=''/>">
54  <!ENTITY response-control-data  "<xref target='RFC7231' x:rel='' xmlns:x=''/>">
55  <!ENTITY resource               "<xref target='RFC7231' x:rel='#resources' xmlns:x=''/>">
56  <!ENTITY semantics              "<xref target='RFC7231' xmlns:x=''/>">
57  <!ENTITY status-codes           "<xref target='RFC7231' x:rel='' xmlns:x=''/>">
58  <!ENTITY status-1xx             "<xref target='RFC7231' x:rel='#status.1xx' xmlns:x=''/>">
59  <!ENTITY status-203             "<xref target='RFC7231' x:rel='#status.203' xmlns:x=''/>">
60  <!ENTITY status-3xx             "<xref target='RFC7231' x:rel='#status.3xx' xmlns:x=''/>">
61  <!ENTITY status-304             "<xref target='RFC7232' x:rel='#status.304' xmlns:x=''/>">
62  <!ENTITY status-4xx             "<xref target='RFC7231' x:rel='#status.4xx' xmlns:x=''/>">
63  <!ENTITY status-413             "<xref target='RFC7231' x:rel='#status.413' xmlns:x=''/>">
64  <!ENTITY status-414             "<xref target='RFC7231' x:rel='#status.414' xmlns:x=''/>">
65  <!ENTITY iana-header-registry   "<xref target='RFC7231' x:rel='#header.field.registry' xmlns:x=''/>">
67<?rfc toc="yes" ?>
68<?rfc symrefs="yes" ?>
69<?rfc sortrefs="yes" ?>
70<?rfc compact="yes"?>
71<?rfc subcompact="no" ?>
72<?rfc linkmailto="no" ?>
73<?rfc editing="no" ?>
74<?rfc comments="yes"?>
75<?rfc inline="yes"?>
76<?rfc rfcedstyle="yes"?>
77<?rfc-ext allow-markup-in-artwork="yes" ?>
78<?rfc-ext include-references-in-index="yes" ?>
79<rfc obsoletes="2145, 2616" updates="2817, 2818" category="std" x:maturity-level="proposed"
80     ipr="pre5378Trust200902" docName="draft-ietf-httpbis-p1-messaging-&ID-VERSION;"
81     xmlns:x=''>
82<x:link rel="next" basename="p2-semantics"/>
83<x:feedback template="{docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
86  <title abbrev="HTTP/1.1 Message Syntax and Routing">Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
88  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
89    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
90    <address>
91      <postal>
92        <street>345 Park Ave</street>
93        <city>San Jose</city>
94        <region>CA</region>
95        <code>95110</code>
96        <country>USA</country>
97      </postal>
98      <email></email>
99      <uri></uri>
100    </address>
101  </author>
103  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
104    <organization abbrev="greenbytes">greenbytes GmbH</organization>
105    <address>
106      <postal>
107        <street>Hafenweg 16</street>
108        <city>Muenster</city><region>NW</region><code>48155</code>
109        <country>Germany</country>
110      </postal>
111      <email></email>
112      <uri></uri>
113    </address>
114  </author>
116  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
118  <area>Applications</area>
119  <workgroup>HTTPbis</workgroup>
123   The Hypertext Transfer Protocol (HTTP) is a stateless application-level
124   protocol for distributed, collaborative, hypertext information systems.
125   This document provides an overview of HTTP architecture and its associated
126   terminology, defines the "http" and "https" Uniform Resource Identifier
127   (URI) schemes, defines the HTTP/1.1 message syntax and parsing
128   requirements, and describes related security concerns for implementations.
132<note title="Editorial Note (To be removed by RFC Editor)">
133  <t>
134    Discussion of this draft takes place on the HTTPBIS working group
135    mailing list (, which is archived at
136    <eref target=""/>.
137  </t>
138  <t>
139    The current issues list is at
140    <eref target=""/> and related
141    documents (including fancy diffs) can be found at
142    <eref target=""/>.
143  </t>
144  <t>
145    <spanx>This is a temporary document for the purpose of tracking the editorial changes made during the AUTH48 (RFC publication) phase.</spanx>
146  </t>
150<section title="Introduction" anchor="introduction">
152   The Hypertext Transfer Protocol (HTTP) is a stateless application-level
153   request/response protocol that uses extensible semantics and
154   self-descriptive message payloads for flexible interaction with
155   network-based hypertext information systems. This document is the first in
156   a series of documents that collectively form the HTTP/1.1 specification:
157   <list style="empty">
158    <t>RFC 7230: Message Syntax and Routing</t>
159    <t><xref target="RFC7231" x:fmt="none">RFC 7231</xref>: Semantics and Content</t>
160    <t><xref target="RFC7232" x:fmt="none">RFC 7232</xref>: Conditional Requests</t>
161    <t><xref target="RFC7233" x:fmt="none">RFC 7233</xref>: Range Requests</t>
162    <t><xref target="RFC7234" x:fmt="none">RFC 7234</xref>: Caching</t>
163    <t><xref target="RFC7234" x:fmt="none">RFC 7235</xref>: Authentication</t>
164   </list>
167   This HTTP/1.1 specification obsoletes
168   <xref target="RFC2616" x:fmt="none">RFC 2616</xref> and
169   <xref target="RFC2145" x:fmt="none">RFC 2145</xref> (on HTTP versioning).
170   This specification also updates the use of CONNECT to establish a tunnel,
171   previously defined in <xref target="RFC2817" x:fmt="none">RFC 2817</xref>,
172   and defines the "https" URI scheme that was described informally in
173   <xref target="RFC2818" x:fmt="none">RFC 2818</xref>.
176   HTTP is a generic interface protocol for information systems. It is
177   designed to hide the details of how a service is implemented by presenting
178   a uniform interface to clients that is independent of the types of
179   resources provided. Likewise, servers do not need to be aware of each
180   client's purpose: an HTTP request can be considered in isolation rather
181   than being associated with a specific type of client or a predetermined
182   sequence of application steps. The result is a protocol that can be used
183   effectively in many different contexts and for which implementations can
184   evolve independently over time.
187   HTTP is also designed for use as an intermediation protocol for translating
188   communication to and from non-HTTP information systems.
189   HTTP proxies and gateways can provide access to alternative information
190   services by translating their diverse protocols into a hypertext
191   format that can be viewed and manipulated by clients in the same way
192   as HTTP services.
195   One consequence of this flexibility is that the protocol cannot be
196   defined in terms of what occurs behind the interface. Instead, we
197   are limited to defining the syntax of communication, the intent
198   of received communication, and the expected behavior of recipients.
199   If the communication is considered in isolation, then successful
200   actions ought to be reflected in corresponding changes to the
201   observable interface provided by servers. However, since multiple
202   clients might act in parallel and perhaps at cross-purposes, we
203   cannot require that such changes be observable beyond the scope
204   of a single response.
207   This document describes the architectural elements that are used or
208   referred to in HTTP, defines the "http" and "https" URI schemes,
209   describes overall network operation and connection management,
210   and defines HTTP message framing and forwarding requirements.
211   Our goal is to define all of the mechanisms necessary for HTTP message
212   handling that are independent of message semantics, thereby defining the
213   complete set of requirements for message parsers and
214   message-forwarding intermediaries.
218<section title="Requirements Notation" anchor="intro.requirements">
220   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
221   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
222   document are to be interpreted as described in <xref target="RFC2119"/>.
225   Conformance criteria and considerations regarding error handling
226   are defined in <xref target="conformance"/>.
230<section title="Syntax Notation" anchor="notation">
231<iref primary="true" item="Grammar" subitem="ALPHA"/>
232<iref primary="true" item="Grammar" subitem="CR"/>
233<iref primary="true" item="Grammar" subitem="CRLF"/>
234<iref primary="true" item="Grammar" subitem="CTL"/>
235<iref primary="true" item="Grammar" subitem="DIGIT"/>
236<iref primary="true" item="Grammar" subitem="DQUOTE"/>
237<iref primary="true" item="Grammar" subitem="HEXDIG"/>
238<iref primary="true" item="Grammar" subitem="HTAB"/>
239<iref primary="true" item="Grammar" subitem="LF"/>
240<iref primary="true" item="Grammar" subitem="OCTET"/>
241<iref primary="true" item="Grammar" subitem="SP"/>
242<iref primary="true" item="Grammar" subitem="VCHAR"/>
244   This specification uses the Augmented Backus-Naur Form (ABNF) notation of
245   <xref target="RFC5234"/> with a list extension, defined in
246   <xref target="abnf.extension"/>, that allows for compact definition of
247   comma-separated lists using a '#' operator (similar to how the '*' operator
248   indicates repetition).
249   <xref target="collected.abnf"/> shows the collected grammar with all list
250   operators expanded to standard ABNF notation.
252<t anchor="core.rules">
253  <x:anchor-alias value="ALPHA"/>
254  <x:anchor-alias value="CTL"/>
255  <x:anchor-alias value="CR"/>
256  <x:anchor-alias value="CRLF"/>
257  <x:anchor-alias value="DIGIT"/>
258  <x:anchor-alias value="DQUOTE"/>
259  <x:anchor-alias value="HEXDIG"/>
260  <x:anchor-alias value="HTAB"/>
261  <x:anchor-alias value="LF"/>
262  <x:anchor-alias value="OCTET"/>
263  <x:anchor-alias value="SP"/>
264  <x:anchor-alias value="VCHAR"/>
265   The following core rules are included by
266   reference, as defined in <xref target="RFC5234" x:fmt="," x:sec="B.1"/>:
267   ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls),
268   DIGIT (decimal 0-9), DQUOTE (double quote),
269   HEXDIG (hexadecimal 0-9/A-F/a-f), HTAB (horizontal tab), LF (line feed),
270   OCTET (any 8-bit sequence of data), SP (space), and
271   VCHAR (any visible <xref target="USASCII"/> character).
274   As a convention, ABNF rule names prefixed with "obs-" denote
275   "obsolete" grammar rules that appear for historical reasons.
280<section title="Architecture" anchor="architecture">
282   HTTP was created for the World Wide Web (WWW) architecture
283   and has evolved over time to support the scalability needs of a worldwide
284   hypertext system. Much of that architecture is reflected in the terminology
285   and syntax productions used to define HTTP.
288<section title="Client/Server Messaging" anchor="operation">
289<iref primary="true" item="client"/>
290<iref primary="true" item="server"/>
291<iref primary="true" item="connection"/>
293   HTTP is a stateless request/response protocol that operates by exchanging
294   <x:dfn>messages</x:dfn> (<xref target="http.message"/>) across a reliable
295   transport or session-layer
296   "<x:dfn>connection</x:dfn>" (<xref target=""/>).
297   An HTTP "<x:dfn>client</x:dfn>" is a program that establishes a connection
298   to a server for the purpose of sending one or more HTTP requests.
299   An HTTP "<x:dfn>server</x:dfn>" is a program that accepts connections
300   in order to service HTTP requests by sending HTTP responses.
302<iref primary="true" item="user agent"/>
303<iref primary="true" item="origin server"/>
304<iref primary="true" item="browser"/>
305<iref primary="true" item="spider"/>
306<iref primary="true" item="sender"/>
307<iref primary="true" item="recipient"/>
309   The terms client and server refer only to the roles that
310   these programs perform for a particular connection.  The same program
311   might act as a client on some connections and a server on others.
312   The term "<x:dfn>user agent</x:dfn>" refers to any of the various
313   client programs that initiate a request, including (but not limited to)
314   browsers, spiders (web-based robots), command-line tools, custom
315   applications, and mobile apps.
316   The term "<x:dfn>origin server</x:dfn>" refers to the program that can
317   originate authoritative responses for a given target resource.
318   The terms "<x:dfn>sender</x:dfn>" and "<x:dfn>recipient</x:dfn>" refer to
319   any implementation that sends or receives a given message, respectively.
322   HTTP relies upon the Uniform Resource Identifier (URI)
323   standard <xref target="RFC3986"/> to indicate the target resource
324   (<xref target="target-resource"/>) and relationships between resources.
325   Messages are passed in a format similar to that used by Internet mail
326   <xref target="RFC5322"/> and the Multipurpose Internet Mail Extensions
327   (MIME) <xref target="RFC2045"/> (see &diff-mime; for the differences
328   between HTTP and MIME messages).
331   Most HTTP communication consists of a retrieval request (GET) for
332   a representation of some resource identified by a URI.  In the
333   simplest case, this might be accomplished via a single bidirectional
334   connection (===) between the user agent (UA) and the origin server (O).
336<figure><artwork type="drawing">
337         request   &gt;
338    <x:highlight>UA</x:highlight> ======================================= <x:highlight>O</x:highlight>
339                                &lt;   response
341<iref primary="true" item="message"/>
342<iref primary="true" item="request"/>
343<iref primary="true" item="response"/>
345   A client sends an HTTP request to a server in the form of a <x:dfn>request</x:dfn>
346   message, beginning with a request-line that includes a method, URI, and
347   protocol version (<xref target="request.line"/>),
348   followed by header fields containing
349   request modifiers, client information, and representation metadata
350   (<xref target="header.fields"/>),
351   an empty line to indicate the end of the header section, and finally
352   a message body containing the payload body (if any,
353   <xref target="message.body"/>).
356   A server responds to a client's request by sending one or more HTTP
357   <x:dfn>response</x:dfn>
358   messages, each beginning with a status line that
359   includes the protocol version, a success or error code, and textual
360   reason phrase (<xref target="status.line"/>),
361   possibly followed by header fields containing server
362   information, resource metadata, and representation metadata
363   (<xref target="header.fields"/>),
364   an empty line to indicate the end of the header section, and finally
365   a message body containing the payload body (if any,
366   <xref target="message.body"/>).
369   A connection might be used for multiple request/response exchanges,
370   as defined in <xref target="persistent.connections"/>.
373   The following example illustrates a typical message exchange for a
374   GET request (&GET;) on the URI "":
377Client request:
378</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
379GET /hello.txt HTTP/1.1
380User-Agent: curl/7.16.3 libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
382Accept-Language: en, mi
386Server response:
387</preamble><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
388HTTP/1.1 200 OK
389Date: Mon, 27 Jul 2009 12:28:53 GMT
390Server: Apache
391Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
392ETag: "34aa387-d-1568eb00"
393Accept-Ranges: bytes
394Content-Length: <x:length-of target="exbody"/>
395Vary: Accept-Encoding
396Content-Type: text/plain
398<x:span anchor="exbody">Hello World! My payload includes a trailing CRLF.
403<section title="Implementation Diversity" anchor="implementation-diversity">
405   When considering the design of HTTP, it is easy to fall into a trap of
406   thinking that all user agents are general-purpose browsers and all origin
407   servers are large public websites. That is not the case in practice.
408   Common HTTP user agents include household appliances, stereos, scales,
409   firmware update scripts, command-line programs, mobile apps,
410   and communication devices in a multitude of shapes and sizes.  Likewise,
411   common HTTP origin servers include home automation units, configurable
412   networking components, office machines, autonomous robots, news feeds,
413   traffic cameras, ad selectors, and video delivery platforms.
416   The term "user agent" does not imply that there is a human user directly
417   interacting with the software agent at the time of a request. In many
418   cases, a user agent is installed or configured to run in the background
419   and save its results for later inspection (or save only a subset of those
420   results that might be interesting or erroneous). Spiders, for example, are
421   typically given a start URI and configured to follow certain behavior while
422   crawling the Web as a hypertext graph.
425   The implementation diversity of HTTP means that not all user agents can
426   make interactive suggestions to their user or provide adequate warning for
427   security or privacy concerns. In the few cases where this
428   specification requires reporting of errors to the user, it is acceptable
429   for such reporting to only be observable in an error console or log file.
430   Likewise, requirements that an automated action be confirmed by the user
431   before proceeding might be met via advance configuration choices,
432   run-time options, or simple avoidance of the unsafe action; confirmation
433   does not imply any specific user interface or interruption of normal
434   processing if the user has already made that choice.
438<section title="Intermediaries" anchor="intermediaries">
439<iref primary="true" item="intermediary"/>
441   HTTP enables the use of intermediaries to satisfy requests through
442   a chain of connections.  There are three common forms of HTTP
443   <x:dfn>intermediary</x:dfn>: proxy, gateway, and tunnel.  In some cases,
444   a single intermediary might act as an origin server, proxy, gateway,
445   or tunnel, switching behavior based on the nature of each request.
447<figure><artwork type="drawing">
448         &gt;             &gt;             &gt;             &gt;
449    <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>
450               &lt;             &lt;             &lt;             &lt;
453   The figure above shows three intermediaries (A, B, and C) between the
454   user agent and origin server. A request or response message that
455   travels the whole chain will pass through four separate connections.
456   Some HTTP communication options
457   might apply only to the connection with the nearest, non-tunnel
458   neighbor, only to the end-points of the chain, or to all connections
459   along the chain. Although the diagram is linear, each participant might
460   be engaged in multiple, simultaneous communications. For example, B
461   might be receiving requests from many clients other than A, and/or
462   forwarding requests to servers other than C, at the same time that it
463   is handling A's request. Likewise, later requests might be sent through a
464   different path of connections, often based on dynamic configuration for
465   load balancing.   
468<iref primary="true" item="upstream"/><iref primary="true" item="downstream"/>
469<iref primary="true" item="inbound"/><iref primary="true" item="outbound"/>
470   The terms "<x:dfn>upstream</x:dfn>" and "<x:dfn>downstream</x:dfn>" are
471   used to describe directional requirements in relation to the message flow:
472   all messages flow from upstream to downstream.
473   The terms inbound and outbound are used to describe directional
474   requirements in relation to the request route:
475   "<x:dfn>inbound</x:dfn>" means toward the origin server and
476   "<x:dfn>outbound</x:dfn>" means toward the user agent.
478<t><iref primary="true" item="proxy"/>
479   A "<x:dfn>proxy</x:dfn>" is a message forwarding agent that is selected by the
480   client, usually via local configuration rules, to receive requests
481   for some type(s) of absolute URI and attempt to satisfy those
482   requests via translation through the HTTP interface.  Some translations
483   are minimal, such as for proxy requests for "http" URIs, whereas
484   other requests might require translation to and from entirely different
485   application-level protocols. Proxies are often used to group an
486   organization's HTTP requests through a common intermediary for the
487   sake of security, annotation services, or shared caching. Some proxies
488   are designed to apply transformations to selected messages or payloads
489   while they are being forwarded, as described in
490   <xref target="message.transformations"/>.
492<t><iref primary="true" item="gateway"/><iref primary="true" item="reverse proxy"/>
493<iref primary="true" item="accelerator"/>
494   A "<x:dfn>gateway</x:dfn>" (a.k.a. "<x:dfn>reverse proxy</x:dfn>") is an
495   intermediary that acts as an origin server for the outbound connection but
496   translates received requests and forwards them inbound to another server or
497   servers. Gateways are often used to encapsulate legacy or untrusted
498   information services, to improve server performance through
499   "<x:dfn>accelerator</x:dfn>" caching, and to enable partitioning or load
500   balancing of HTTP services across multiple machines.
503   All HTTP requirements applicable to an origin server
504   also apply to the outbound communication of a gateway.
505   A gateway communicates with inbound servers using any protocol that
506   it desires, including private extensions to HTTP that are outside
507   the scope of this specification.  However, an HTTP-to-HTTP gateway
508   that wishes to interoperate with third-party HTTP servers ought to conform
509   to user agent requirements on the gateway's inbound connection.
511<t><iref primary="true" item="tunnel"/>
512   A "<x:dfn>tunnel</x:dfn>" acts as a blind relay between two connections
513   without changing the messages. Once active, a tunnel is not
514   considered a party to the HTTP communication, though the tunnel might
515   have been initiated by an HTTP request. A tunnel ceases to exist when
516   both ends of the relayed connection are closed. Tunnels are used to
517   extend a virtual connection through an intermediary, such as when
518   Transport Layer Security (TLS, <xref target="RFC5246"/>) is used to
519   establish confidential communication through a shared firewall proxy.
522   The above categories for intermediary only consider those acting as
523   participants in the HTTP communication.  There are also intermediaries
524   that can act on lower layers of the network protocol stack, filtering or
525   redirecting HTTP traffic without the knowledge or permission of message
526   senders. Network intermediaries are indistinguishable (at a protocol level)
527   from a man-in-the-middle attack, often introducing security flaws or
528   interoperability problems due to mistakenly violating HTTP semantics.
530<t><iref primary="true" item="interception proxy"/>
531<iref primary="true" item="transparent proxy"/>
532<iref primary="true" item="captive portal"/>
533   For example, an
534   "<x:dfn>interception proxy</x:dfn>" <xref target="RFC3040"/> (also commonly
535   known as a "<x:dfn>transparent proxy</x:dfn>" <xref target="RFC1919"/> or
536   "<x:dfn>captive portal</x:dfn>")
537   differs from an HTTP proxy because it is not selected by the client.
538   Instead, an interception proxy filters or redirects outgoing TCP port 80
539   packets (and occasionally other common port traffic).
540   Interception proxies are commonly found on public network access points,
541   as a means of enforcing account subscription prior to allowing use of
542   non-local Internet services, and within corporate firewalls to enforce
543   network usage policies.
546   HTTP is defined as a stateless protocol, meaning that each request message
547   can be understood in isolation.  Many implementations depend on HTTP's
548   stateless design in order to reuse proxied connections or dynamically
549   load-balance requests across multiple servers.  Hence, a server &MUST-NOT;
550   assume that two requests on the same connection are from the same user
551   agent unless the connection is secured and specific to that agent.
552   Some non-standard HTTP extensions (e.g., <xref target="RFC4559"/>) have
553   been known to violate this requirement, resulting in security and
554   interoperability problems.
558<section title="Caches" anchor="caches">
559<iref primary="true" item="cache"/>
561   A "<x:dfn>cache</x:dfn>" is a local store of previous response messages and the
562   subsystem that controls its message storage, retrieval, and deletion.
563   A cache stores cacheable responses in order to reduce the response
564   time and network bandwidth consumption on future, equivalent
565   requests. Any client or server &MAY; employ a cache, though a cache
566   cannot be used by a server while it is acting as a tunnel.
569   The effect of a cache is that the request/response chain is shortened
570   if one of the participants along the chain has a cached response
571   applicable to that request. The following illustrates the resulting
572   chain if B has a cached copy of an earlier response from O (via C)
573   for a request that has not been cached by UA or A.
575<figure><artwork type="drawing">
576            &gt;             &gt;
577       <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>
578                  &lt;             &lt;
580<t><iref primary="true" item="cacheable"/>
581   A response is "<x:dfn>cacheable</x:dfn>" if a cache is allowed to store a copy of
582   the response message for use in answering subsequent requests.
583   Even when a response is cacheable, there might be additional
584   constraints placed by the client or by the origin server on when
585   that cached response can be used for a particular request. HTTP
586   requirements for cache behavior and cacheable responses are
587   defined in &caching-overview;. 
590   There are a wide variety of architectures and configurations
591   of caches deployed across the World Wide Web and
592   inside large organizations. These include national hierarchies
593   of proxy caches to save transoceanic bandwidth, collaborative systems that
594   broadcast or multicast cache entries, archives of pre-fetched cache
595   entries for use in off-line or high-latency environments, and so on.
599<section title="Conformance and Error Handling" anchor="conformance">
601   This specification targets conformance criteria according to the role of
602   a participant in HTTP communication.  Hence, HTTP requirements are placed
603   on senders, recipients, clients, servers, user agents, intermediaries,
604   origin servers, proxies, gateways, or caches, depending on what behavior
605   is being constrained by the requirement. Additional (social) requirements
606   are placed on implementations, resource owners, and protocol element
607   registrations when they apply beyond the scope of a single communication.
610   The verb "generate" is used instead of "send" where a requirement
611   differentiates between creating a protocol element and merely forwarding a
612   received element downstream.
615   An implementation is considered conformant if it complies with all of the
616   requirements associated with the roles it partakes in HTTP.
619   Conformance includes both the syntax and semantics of protocol
620   elements. A sender &MUST-NOT; generate protocol elements that convey a
621   meaning that is known by that sender to be false. A sender &MUST-NOT;
622   generate protocol elements that do not match the grammar defined by the
623   corresponding ABNF rules. Within a given message, a sender &MUST-NOT;
624   generate protocol elements or syntax alternatives that are only allowed to
625   be generated by participants in other roles (i.e., a role that the sender
626   does not have for that message).
629   When a received protocol element is parsed, the recipient &MUST; be able to
630   parse any value of reasonable length that is applicable to the recipient's
631   role and matches the grammar defined by the corresponding ABNF rules.
632   Note, however, that some received protocol elements might not be parsed.
633   For example, an intermediary forwarding a message might parse a
634   header-field into generic field-name and field-value components, but then
635   forward the header field without further parsing inside the field-value.
638   HTTP does not have specific length limitations for many of its protocol
639   elements because the lengths that might be appropriate will vary widely,
640   depending on the deployment context and purpose of the implementation.
641   Hence, interoperability between senders and recipients depends on shared
642   expectations regarding what is a reasonable length for each protocol
643   element. Furthermore, what is commonly understood to be a reasonable length
644   for some protocol elements has changed over the course of the past two
645   decades of HTTP use and is expected to continue changing in the future.
648   At a minimum, a recipient &MUST; be able to parse and process protocol
649   element lengths that are at least as long as the values that it generates
650   for those same protocol elements in other messages. For example, an origin
651   server that publishes very long URI references to its own resources needs
652   to be able to parse and process those same references when received as a
653   request target.
656   A recipient &MUST; interpret a received protocol element according to the
657   semantics defined for it by this specification, including extensions to
658   this specification, unless the recipient has determined (through experience
659   or configuration) that the sender incorrectly implements what is implied by
660   those semantics.
661   For example, an origin server might disregard the contents of a received
662   <x:ref>Accept-Encoding</x:ref> header field if inspection of the
663   <x:ref>User-Agent</x:ref> header field indicates a specific implementation
664   version that is known to fail on receipt of certain content codings.
667   Unless noted otherwise, a recipient &MAY; attempt to recover a usable
668   protocol element from an invalid construct.  HTTP does not define
669   specific error handling mechanisms except when they have a direct impact
670   on security, since different applications of the protocol require
671   different error handling strategies.  For example, a Web browser might
672   wish to transparently recover from a response where the
673   <x:ref>Location</x:ref> header field doesn't parse according to the ABNF,
674   whereas a systems control client might consider any form of error recovery
675   to be dangerous.
679<section title="Protocol Versioning" anchor="http.version">
680  <x:anchor-alias value="HTTP-version"/>
681  <x:anchor-alias value="HTTP-name"/>
683   HTTP uses a "&lt;major&gt;.&lt;minor&gt;" numbering scheme to indicate
684   versions of the protocol. This specification defines version "1.1".
685   The protocol version as a whole indicates the sender's conformance
686   with the set of requirements laid out in that version's corresponding
687   specification of HTTP.
690   The version of an HTTP message is indicated by an HTTP-version field
691   in the first line of the message. HTTP-version is case-sensitive.
693<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-version"/><iref primary="true" item="Grammar" subitem="HTTP-name"/>
694  <x:ref>HTTP-version</x:ref>  = <x:ref>HTTP-name</x:ref> "/" <x:ref>DIGIT</x:ref> "." <x:ref>DIGIT</x:ref>
695  <x:ref>HTTP-name</x:ref>     = <x:abnf-char-sequence>"HTTP"</x:abnf-char-sequence> ; "HTTP", case-sensitive
698   The HTTP version number consists of two decimal digits separated by a "."
699   (period or decimal point).  The first digit ("major version") indicates the
700   HTTP messaging syntax, whereas the second digit ("minor version") indicates
701   the highest minor version within that major version to which the sender is
702   conformant and able to understand for future communication.  The minor
703   version advertises the sender's communication capabilities even when the
704   sender is only using a backwards-compatible subset of the protocol,
705   thereby letting the recipient know that more advanced features can
706   be used in response (by servers) or in future requests (by clients).
709   When an HTTP/1.1 message is sent to an HTTP/1.0 recipient
710   <xref target="RFC1945"/> or a recipient whose version is unknown,
711   the HTTP/1.1 message is constructed such that it can be interpreted
712   as a valid HTTP/1.0 message if all of the newer features are ignored.
713   This specification places recipient-version requirements on some
714   new features so that a conformant sender will only use compatible
715   features until it has determined, through configuration or the
716   receipt of a message, that the recipient supports HTTP/1.1.
719   The interpretation of a header field does not change between minor
720   versions of the same major HTTP version, though the default
721   behavior of a recipient in the absence of such a field can change.
722   Unless specified otherwise, header fields defined in HTTP/1.1 are
723   defined for all versions of HTTP/1.x.  In particular, the <x:ref>Host</x:ref>
724   and <x:ref>Connection</x:ref> header fields ought to be implemented by all
725   HTTP/1.x implementations whether or not they advertise conformance with
726   HTTP/1.1.
729   New header fields can be introduced without changing the protocol version
730   if their defined semantics allow them to be safely ignored by recipients
731   that do not recognize them. Header field extensibility is discussed in
732   <xref target="field.extensibility"/>.
735   Intermediaries that process HTTP messages (i.e., all intermediaries
736   other than those acting as tunnels) &MUST; send their own HTTP-version
737   in forwarded messages.  In other words, they are not allowed to blindly
738   forward the first line of an HTTP message without ensuring that the
739   protocol version in that message matches a version to which that
740   intermediary is conformant for both the receiving and
741   sending of messages.  Forwarding an HTTP message without rewriting
742   the HTTP-version might result in communication errors when downstream
743   recipients use the message sender's version to determine what features
744   are safe to use for later communication with that sender.
747   A client &SHOULD; send a request version equal to the highest
748   version to which the client is conformant and
749   whose major version is no higher than the highest version supported
750   by the server, if this is known.  A client &MUST-NOT; send a
751   version to which it is not conformant.
754   A client &MAY; send a lower request version if it is known that
755   the server incorrectly implements the HTTP specification, but only
756   after the client has attempted at least one normal request and determined
757   from the response status code or header fields (e.g., <x:ref>Server</x:ref>) that
758   the server improperly handles higher request versions.
761   A server &SHOULD; send a response version equal to the highest version to
762   which the server is conformant that has a major version less than or equal
763   to the one received in the request.
764   A server &MUST-NOT; send a version to which it is not conformant.
765   A server can send a <x:ref>505 (HTTP Version Not Supported)</x:ref>
766   response if it wishes, for any reason, to refuse service of the client's
767   major protocol version.
770   A server &MAY; send an HTTP/1.0 response to a request
771   if it is known or suspected that the client incorrectly implements the
772   HTTP specification and is incapable of correctly processing later
773   version responses, such as when a client fails to parse the version
774   number correctly or when an intermediary is known to blindly forward
775   the HTTP-version even when it doesn't conform to the given minor
776   version of the protocol. Such protocol downgrades &SHOULD-NOT; be
777   performed unless triggered by specific client attributes, such as when
778   one or more of the request header fields (e.g., <x:ref>User-Agent</x:ref>)
779   uniquely match the values sent by a client known to be in error.
782   The intention of HTTP's versioning design is that the major number
783   will only be incremented if an incompatible message syntax is
784   introduced, and that the minor number will only be incremented when
785   changes made to the protocol have the effect of adding to the message
786   semantics or implying additional capabilities of the sender.  However,
787   the minor version was not incremented for the changes introduced between
788   <xref target="RFC2068"/> and <xref target="RFC2616"/>, and this revision
789   has specifically avoided any such changes to the protocol.
792   When an HTTP message is received with a major version number that the
793   recipient implements, but a higher minor version number than what the
794   recipient implements, the recipient &SHOULD; process the message as if it
795   were in the highest minor version within that major version to which the
796   recipient is conformant. A recipient can assume that a message with a
797   higher minor version, when sent to a recipient that has not yet indicated
798   support for that higher version, is sufficiently backwards-compatible to be
799   safely processed by any implementation of the same major version.
803<section title="Uniform Resource Identifiers" anchor="uri">
804<iref primary="true" item="resource"/>
806   Uniform Resource Identifiers (URIs) <xref target="RFC3986"/> are used
807   throughout HTTP as the means for identifying resources (&resource;).
808   URI references are used to target requests, indicate redirects, and define
809   relationships.
811  <x:anchor-alias value="URI-reference"/>
812  <x:anchor-alias value="absolute-URI"/>
813  <x:anchor-alias value="relative-part"/>
814  <x:anchor-alias value="scheme"/>
815  <x:anchor-alias value="authority"/>
816  <x:anchor-alias value="uri-host"/>
817  <x:anchor-alias value="port"/>
818  <x:anchor-alias value="path"/>
819  <x:anchor-alias value="path-abempty"/>
820  <x:anchor-alias value="segment"/>
821  <x:anchor-alias value="query"/>
822  <x:anchor-alias value="fragment"/>
823  <x:anchor-alias value="absolute-path"/>
824  <x:anchor-alias value="partial-URI"/>
826   The definitions of "URI-reference",
827   "absolute-URI", "relative-part", "scheme", "authority", "port", "host",
828   "path-abempty", "segment", "query", and "fragment" are adopted from the
829   URI generic syntax.
830   An "absolute-path" rule is defined for protocol elements that can contain a
831   non-empty path component. (This rule differs slightly from RFC 3986's
832   path-abempty rule, which allows for an empty path to be used in references,
833   and path-absolute rule, which does not allow paths that begin with "//".)
834   A "partial-URI" rule is defined for protocol elements
835   that can contain a relative URI but not a fragment component.
837<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>
838  <x:ref>URI-reference</x:ref> = &lt;URI-reference, defined in <xref target="RFC3986" x:fmt="," x:sec="4.1"/>&gt;
839  <x:ref>absolute-URI</x:ref>  = &lt;absolute-URI, defined in <xref target="RFC3986" x:fmt="," x:sec="4.3"/>&gt;
840  <x:ref>relative-part</x:ref> = &lt;relative-part, defined in <xref target="RFC3986" x:fmt="," x:sec="4.2"/>&gt;
841  <x:ref>scheme</x:ref>        = &lt;scheme, defined in <xref target="RFC3986" x:fmt="," x:sec="3.1"/>&gt;
842  <x:ref>authority</x:ref>     = &lt;authority, defined in <xref target="RFC3986" x:fmt="," x:sec="3.2"/>&gt;
843  <x:ref>uri-host</x:ref>      = &lt;host, defined in <xref target="RFC3986" x:fmt="," x:sec="3.2.2"/>&gt;
844  <x:ref>port</x:ref>          = &lt;port, defined in <xref target="RFC3986" x:fmt="," x:sec="3.2.3"/>&gt;
845  <x:ref>path-abempty</x:ref>  = &lt;path-abempty, defined in <xref target="RFC3986" x:fmt="," x:sec="3.3"/>&gt;
846  <x:ref>segment</x:ref>       = &lt;segment, defined in <xref target="RFC3986" x:fmt="," x:sec="3.3"/>&gt;
847  <x:ref>query</x:ref>         = &lt;query, defined in <xref target="RFC3986" x:fmt="," x:sec="3.4"/>&gt;
848  <x:ref>fragment</x:ref>      = &lt;fragment, defined in <xref target="RFC3986" x:fmt="," x:sec="3.5"/>&gt;
850  <x:ref>absolute-path</x:ref> = 1*( "/" segment )
851  <x:ref>partial-URI</x:ref>   = relative-part [ "?" query ]
854   Each protocol element in HTTP that allows a URI reference will indicate
855   in its ABNF production whether the element allows any form of reference
856   (URI-reference), only a URI in absolute form (absolute-URI), only the
857   path and optional query components, or some combination of the above.
858   Unless otherwise indicated, URI references are parsed
859   relative to the effective request URI
860   (<xref target="effective.request.uri"/>).
863<section title="http URI Scheme" anchor="http.uri">
864  <x:anchor-alias value="http-URI"/>
865  <iref item="http URI scheme" primary="true"/>
866  <iref item="URI scheme" subitem="http" primary="true"/>
868   The "http" URI scheme is hereby defined for the purpose of minting
869   identifiers according to their association with the hierarchical
870   namespace governed by a potential HTTP origin server listening for
871   TCP (<xref target="RFC0793"/>) connections on a given port.
873<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="http-URI"><!--terminal production--></iref>
874  <x:ref>http-URI</x:ref> = "http:" "//" <x:ref>authority</x:ref> <x:ref>path-abempty</x:ref> [ "?" <x:ref>query</x:ref> ]
875             [ "#" <x:ref>fragment</x:ref> ]
878   The origin server for an "http" URI is identified by the
879   <x:ref>authority</x:ref> component, which includes a host identifier
880   and optional TCP port (<xref target="RFC3986" x:fmt="," x:sec="3.2.2"/>).
881   The hierarchical path component and optional query component serve as an
882   identifier for a potential target resource within that origin server's name
883   space. The optional fragment component allows for indirect identification
884   of a secondary resource, independent of the URI scheme, as defined in
885   <xref target="RFC3986" x:fmt="of" x:sec="3.5"/>.
888   A sender &MUST-NOT; generate an "http" URI with an empty host identifier.
889   A recipient that processes such a URI reference &MUST; reject it as invalid.
892   If the host identifier is provided as an IP address, the origin server is
893   the listener (if any) on the indicated TCP port at that IP address.
894   If host is a registered name, the registered name is an indirect identifier
895   for use with a name resolution service, such as DNS, to find an address for
896   that origin server.
897   If the port subcomponent is empty or not given, TCP port 80 (the
898   reserved port for WWW services) is the default.
901   Note that the presence of a URI with a given authority component does not
902   imply that there is always an HTTP server listening for connections on
903   that host and port. Anyone can mint a URI. What the authority component
904   determines is who has the right to respond authoritatively to requests that
905   target the identified resource. The delegated nature of registered names
906   and IP addresses creates a federated namespace, based on control over the
907   indicated host and port, whether or not an HTTP server is present.
908   See <xref target="establishing.authority"/> for security considerations
909   related to establishing authority.
912   When an "http" URI is used within a context that calls for access to the
913   indicated resource, a client &MAY; attempt access by resolving
914   the host to an IP address, establishing a TCP connection to that address
915   on the indicated port, and sending an HTTP request message
916   (<xref target="http.message"/>) containing the URI's identifying data
917   (<xref target="message.routing"/>) to the server.
918   If the server responds to that request with a non-interim HTTP response
919   message, as described in &status-codes;, then that response
920   is considered an authoritative answer to the client's request.
923   Although HTTP is independent of the transport protocol, the "http"
924   scheme is specific to TCP-based services because the name delegation
925   process depends on TCP for establishing authority.
926   An HTTP service based on some other underlying connection protocol
927   would presumably be identified using a different URI scheme, just as
928   the "https" scheme (below) is used for resources that require an
929   end-to-end secured connection. Other protocols might also be used to
930   provide access to "http" identified resources &mdash; it is only the
931   authoritative interface that is specific to TCP.
934   The URI generic syntax for authority also includes a deprecated
935   userinfo subcomponent (<xref target="RFC3986" x:fmt="," x:sec="3.2.1"/>)
936   for including user authentication information in the URI.  Some
937   implementations make use of the userinfo component for internal
938   configuration of authentication information, such as within command
939   invocation options, configuration files, or bookmark lists, even
940   though such usage might expose a user identifier or password.
941   A sender &MUST-NOT; generate the userinfo subcomponent (and its "@"
942   delimiter) when an "http" URI reference is generated within a message as a
943   request target or header field value.
944   Before making use of an "http" URI reference received from an untrusted
945   source, a recipient &SHOULD; parse for userinfo and treat its presence as
946   an error; it is likely being used to obscure the authority for the sake of
947   phishing attacks.
951<section title="https URI Scheme" anchor="https.uri">
952   <x:anchor-alias value="https-URI"/>
953   <iref item="https URI scheme"/>
954   <iref item="URI scheme" subitem="https"/>
956   The "https" URI scheme is hereby defined for the purpose of minting
957   identifiers according to their association with the hierarchical
958   namespace governed by a potential HTTP origin server listening to a
959   given TCP port for TLS-secured connections (<xref target="RFC5246"/>).
962   All of the requirements listed above for the "http" scheme are also
963   requirements for the "https" scheme, except that TCP port 443 is the
964   default if the port subcomponent is empty or not given,
965   and the user agent &MUST; ensure that its connection to the origin
966   server is secured through the use of strong encryption, end-to-end,
967   prior to sending the first HTTP request.
969<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="https-URI"><!--terminal production--></iref>
970  <x:ref>https-URI</x:ref> = "https:" "//" <x:ref>authority</x:ref> <x:ref>path-abempty</x:ref> [ "?" <x:ref>query</x:ref> ]
971              [ "#" <x:ref>fragment</x:ref> ]
974   Note that the "https" URI scheme depends on both TLS and TCP for
975   establishing authority.
976   Resources made available via the "https" scheme have no shared
977   identity with the "http" scheme even if their resource identifiers
978   indicate the same authority (the same host listening to the same
979   TCP port).  They are distinct name spaces and are considered to be
980   distinct origin servers.  However, an extension to HTTP that is
981   defined to apply to entire host domains, such as the Cookie protocol
982   <xref target="RFC6265"/>, can allow information
983   set by one service to impact communication with other services
984   within a matching group of host domains.
987   The process for authoritative access to an "https" identified
988   resource is defined in <xref target="RFC2818"/>.
992<section title="http and https URI Normalization and Comparison" anchor="uri.comparison">
994   Since the "http" and "https" schemes conform to the URI generic syntax,
995   such URIs are normalized and compared according to the algorithm defined
996   in <xref target="RFC3986" x:fmt="of" x:sec="6"/>, using the defaults
997   described above for each scheme.
1000   If the port is equal to the default port for a scheme, the normal form is
1001   to omit the port subcomponent. When not being used in absolute form as the
1002   request target of an OPTIONS request, an empty path component is equivalent
1003   to an absolute path of "/", so the normal form is to provide a path of "/"
1004   instead. The scheme and host are case-insensitive and normally provided in
1005   lowercase; all other components are compared in a case-sensitive manner.
1006   Characters other than those in the "reserved" set are equivalent to their
1007   percent-encoded octets: the normal form is to not encode them
1008   (see Sections <xref target="RFC3986" x:fmt="number" x:sec="2.1"/> and
1009   <xref target="RFC3986" x:fmt="number" x:sec="2.2"/> of
1010   <xref target="RFC3986"/>).
1013   For example, the following three URIs are equivalent:
1015<figure><artwork type="example">
1024<section title="Message Format" anchor="http.message">
1025<x:anchor-alias value="generic-message"/>
1026<x:anchor-alias value="message.types"/>
1027<x:anchor-alias value="HTTP-message"/>
1028<x:anchor-alias value="start-line"/>
1029<iref item="header section"/>
1030<iref item="headers"/>
1031<iref item="header field"/>
1033   All HTTP/1.1 messages consist of a start-line followed by a sequence of
1034   octets in a format similar to the Internet Message Format
1035   <xref target="RFC5322"/>: zero or more header fields (collectively
1036   referred to as the "headers" or the "header section"), an empty line
1037   indicating the end of the header section, and an optional message body.
1039<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="HTTP-message"><!--terminal production--></iref>
1040  <x:ref>HTTP-message</x:ref>   = <x:ref>start-line</x:ref>
1041                   *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> )
1042                   <x:ref>CRLF</x:ref>
1043                   [ <x:ref>message-body</x:ref> ]
1046   The normal procedure for parsing an HTTP message is to read the
1047   start-line into a structure, read each header field into a hash
1048   table by field name until the empty line, and then use the parsed
1049   data to determine if a message body is expected.  If a message body
1050   has been indicated, then it is read as a stream until an amount
1051   of octets equal to the message body length is read or the connection
1052   is closed.
1055   A recipient &MUST; parse an HTTP message as a sequence of octets in an
1056   encoding that is a superset of US-ASCII <xref target="USASCII"/>.
1057   Parsing an HTTP message as a stream of Unicode characters, without regard
1058   for the specific encoding, creates security vulnerabilities due to the
1059   varying ways that string processing libraries handle invalid multibyte
1060   character sequences that contain the octet LF (%x0A).  String-based
1061   parsers can only be safely used within protocol elements after the element
1062   has been extracted from the message, such as within a header field-value
1063   after message parsing has delineated the individual fields.
1066   An HTTP message can be parsed as a stream for incremental processing or
1067   forwarding downstream.  However, recipients cannot rely on incremental
1068   delivery of partial messages, since some implementations will buffer or
1069   delay message forwarding for the sake of network efficiency, security
1070   checks, or payload transformations.
1073   A sender &MUST-NOT; send whitespace between the start-line and
1074   the first header field.
1075   A recipient that receives whitespace between the start-line and
1076   the first header field &MUST; either reject the message as invalid or
1077   consume each whitespace-preceded line without further processing of it
1078   (i.e., ignore the entire line, along with any subsequent lines preceded
1079   by whitespace, until a properly formed header field is received or the
1080   header section is terminated).
1083   The presence of such whitespace in a request
1084   might be an attempt to trick a server into ignoring that field or
1085   processing the line after it as a new request, either of which might
1086   result in a security vulnerability if other implementations within
1087   the request chain interpret the same message differently.
1088   Likewise, the presence of such whitespace in a response might be
1089   ignored by some clients or cause others to cease parsing.
1092<section title="Start Line" anchor="start.line">
1093  <x:anchor-alias value="Start-Line"/>
1095   An HTTP message can either be a request from client to server or a
1096   response from server to client.  Syntactically, the two types of message
1097   differ only in the start-line, which is either a request-line (for requests)
1098   or a status-line (for responses), and in the algorithm for determining
1099   the length of the message body (<xref target="message.body"/>).
1102   In theory, a client could receive requests and a server could receive
1103   responses, distinguishing them by their different start-line formats,
1104   but, in practice, servers are implemented to only expect a request
1105   (a response is interpreted as an unknown or invalid request method)
1106   and clients are implemented to only expect a response.
1108<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="start-line"/>
1109  <x:ref>start-line</x:ref>     = <x:ref>request-line</x:ref> / <x:ref>status-line</x:ref>
1112<section title="Request Line" anchor="request.line">
1113  <x:anchor-alias value="Request"/>
1114  <x:anchor-alias value="request-line"/>
1116   A request-line begins with a method token, followed by a single
1117   space (SP), the request-target, another single space (SP), the
1118   protocol version, and ending with CRLF.
1120<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="request-line"/>
1121  <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>
1123<iref primary="true" item="method"/>
1124<t anchor="method">
1125   The method token indicates the request method to be performed on the
1126   target resource. The request method is case-sensitive.
1128<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="method"/>
1129  <x:ref>method</x:ref>         = <x:ref>token</x:ref>
1132   The request methods defined by this specification can be found in
1133   &methods;, along with information regarding the HTTP method registry
1134   and considerations for defining new methods.
1136<iref item="request-target"/>
1138   The request-target identifies the target resource upon which to apply
1139   the request, as defined in <xref target="request-target"/>.
1142   Recipients typically parse the request-line into its component parts by
1143   splitting on whitespace (see <xref target="message.robustness"/>), since
1144   no whitespace is allowed in the three components.
1145   Unfortunately, some user agents fail to properly encode or exclude
1146   whitespace found in hypertext references, resulting in those disallowed
1147   characters being sent in a request-target.
1150   Recipients of an invalid request-line &SHOULD; respond with either a
1151   <x:ref>400 (Bad Request)</x:ref> error or a <x:ref>301 (Moved Permanently)</x:ref>
1152   redirect with the request-target properly encoded.  A recipient &SHOULD-NOT;
1153   attempt to autocorrect and then process the request without a redirect,
1154   since the invalid request-line might be deliberately crafted to bypass
1155   security filters along the request chain.
1158   HTTP does not place a pre-defined limit on the length of a request-line,
1159   as described in <xref target="conformance"/>.
1160   A server that receives a method longer than any that it implements
1161   &SHOULD; respond with a <x:ref>501 (Not Implemented)</x:ref> status code.
1162   A server that receives a request-target longer than any URI it wishes to
1163   parse &MUST; respond with a
1164   <x:ref>414 (URI Too Long)</x:ref> status code (see &status-414;).
1167   Various ad-hoc limitations on request-line length are found in practice.
1168   It is &RECOMMENDED; that all HTTP senders and recipients support, at a
1169   minimum, request-line lengths of 8000 octets.
1173<section title="Status Line" anchor="status.line">
1174  <x:anchor-alias value="response"/>
1175  <x:anchor-alias value="status-line"/>
1176  <x:anchor-alias value="status-code"/>
1177  <x:anchor-alias value="reason-phrase"/>
1179   The first line of a response message is the status-line, consisting
1180   of the protocol version, a space (SP), the status code, another space,
1181   a possibly-empty textual phrase describing the status code, and
1182   ending with CRLF.
1184<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="status-line"/>
1185  <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>
1188   The status-code element is a 3-digit integer code describing the
1189   result of the server's attempt to understand and satisfy the client's
1190   corresponding request. The rest of the response message is to be
1191   interpreted in light of the semantics defined for that status code.
1192   See &status-codes; for information about the semantics of status codes,
1193   including the classes of status code (indicated by the first digit),
1194   the status codes defined by this specification, considerations for the
1195   definition of new status codes, and the IANA registry.
1197<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="status-code"/>
1198  <x:ref>status-code</x:ref>    = 3<x:ref>DIGIT</x:ref>
1201   The reason-phrase element exists for the sole purpose of providing a
1202   textual description associated with the numeric status code, mostly
1203   out of deference to earlier Internet application protocols that were more
1204   frequently used with interactive text clients. A client &SHOULD; ignore
1205   the reason-phrase content.
1207<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="reason-phrase"/>
1208  <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> )
1213<section title="Header Fields" anchor="header.fields">
1214  <x:anchor-alias value="header-field"/>
1215  <x:anchor-alias value="field-content"/>
1216  <x:anchor-alias value="field-name"/>
1217  <x:anchor-alias value="field-value"/>
1218  <x:anchor-alias value="field-vchar"/>
1219  <x:anchor-alias value="obs-fold"/>
1221   Each header field consists of a case-insensitive field name
1222   followed by a colon (":"), optional leading whitespace, the field value,
1223   and optional trailing whitespace.
1225<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"/>
1226  <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>
1228  <x:ref>field-name</x:ref>     = <x:ref>token</x:ref>
1229  <x:ref>field-value</x:ref>    = *( <x:ref>field-content</x:ref> / <x:ref>obs-fold</x:ref> )
1230  <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> ]
1231  <x:ref>field-vchar</x:ref>    = <x:ref>VCHAR</x:ref> / <x:ref>obs-text</x:ref>
1233  <x:ref>obs-fold</x:ref>       = <x:ref>CRLF</x:ref> 1*( <x:ref>SP</x:ref> / <x:ref>HTAB</x:ref> )
1234                 ; obsolete line folding
1235                 ; see <xref target="field.parsing"/>
1238   The field-name token labels the corresponding field-value as having the
1239   semantics defined by that header field.  For example, the <x:ref>Date</x:ref>
1240   header field is defined in &header-date; as containing the origination
1241   timestamp for the message in which it appears.
1244<section title="Field Extensibility" anchor="field.extensibility">
1246   Header fields are fully extensible: there is no limit on the
1247   introduction of new field names, each presumably defining new semantics,
1248   nor on the number of header fields used in a given message.  Existing
1249   fields are defined in each part of this specification and in many other
1250   specifications outside this document set.
1253   New header fields can be defined such that, when they are understood by a
1254   recipient, they might override or enhance the interpretation of previously
1255   defined header fields, define preconditions on request evaluation, or
1256   refine the meaning of responses.
1259   A proxy &MUST; forward unrecognized header fields unless the
1260   field-name is listed in the <x:ref>Connection</x:ref> header field
1261   (<xref target="header.connection"/>) or the proxy is specifically
1262   configured to block, or otherwise transform, such fields.
1263   Other recipients &SHOULD; ignore unrecognized header fields.
1264   These requirements allow HTTP's functionality to be enhanced without
1265   requiring prior update of deployed intermediaries.
1268   All defined header fields ought to be registered with IANA in the
1269   Message Header Field Registry, as described in &iana-header-registry;.
1273<section title="Field Order" anchor="field.order">
1275   The order in which header fields with differing field names are
1276   received is not significant. However, it is good practice to send
1277   header fields that contain control data first, such as <x:ref>Host</x:ref>
1278   on requests and <x:ref>Date</x:ref> on responses, so that implementations
1279   can decide when not to handle a message as early as possible.
1280   A server &MUST-NOT; apply a request to the target resource until the entire
1281   request header section is received, since later header fields might include
1282   conditionals, authentication credentials, or deliberately misleading
1283   duplicate header fields that would impact request processing.
1286   A sender &MUST-NOT; generate multiple header fields with the same field
1287   name in a message unless either the entire field value for that
1288   header field is defined as a comma-separated list [i.e., #(values)]
1289   or the header field is a well-known exception (as noted below).
1292   A recipient &MAY; combine multiple header fields with the same field name
1293   into one "field-name: field-value" pair, without changing the semantics of
1294   the message, by appending each subsequent field value to the combined
1295   field value in order, separated by a comma. The order in which
1296   header fields with the same field name are received is therefore
1297   significant to the interpretation of the combined field value;
1298   a proxy &MUST-NOT; change the order of these field values when
1299   forwarding a message.
1302  <t>
1303   &Note; In practice, the "Set-Cookie" header field (<xref target="RFC6265"/>)
1304   often appears multiple times in a response message and does not use the
1305   list syntax, violating the above requirements on multiple header fields
1306   with the same name. Since it cannot be combined into a single field-value,
1307   recipients ought to handle "Set-Cookie" as a special case while processing
1308   header fields. (See Appendix A.2.3 of <xref target="Kri2001"/> for details.)
1309  </t>
1313<section title="Whitespace" anchor="whitespace">
1314<t anchor="rule.LWS">
1315   This specification uses three rules to denote the use of linear
1316   whitespace: OWS (optional whitespace), RWS (required whitespace), and
1317   BWS ("bad" whitespace).
1319<t anchor="rule.OWS">
1320   The OWS rule is used where zero or more linear whitespace octets might
1321   appear. For protocol elements where optional whitespace is preferred to
1322   improve readability, a sender &SHOULD; generate the optional whitespace
1323   as a single SP; otherwise, a sender &SHOULD-NOT; generate optional
1324   whitespace except as needed to white-out invalid or unwanted protocol
1325   elements during in-place message filtering.
1327<t anchor="rule.RWS">
1328   The RWS rule is used when at least one linear whitespace octet is required
1329   to separate field tokens. A sender &SHOULD; generate RWS as a single SP.
1331<t anchor="rule.BWS">
1332   The BWS rule is used where the grammar allows optional whitespace only for
1333   historical reasons. A sender &MUST-NOT; generate BWS in messages.
1334   A recipient &MUST; parse for such bad whitespace and remove it before
1335   interpreting the protocol element.
1337<t anchor="rule.whitespace">
1338  <x:anchor-alias value="BWS"/>
1339  <x:anchor-alias value="OWS"/>
1340  <x:anchor-alias value="RWS"/>
1342<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"/>
1343  <x:ref>OWS</x:ref>            = *( <x:ref>SP</x:ref> / <x:ref>HTAB</x:ref> )
1344                 ; optional whitespace
1345  <x:ref>RWS</x:ref>            = 1*( <x:ref>SP</x:ref> / <x:ref>HTAB</x:ref> )
1346                 ; required whitespace
1347  <x:ref>BWS</x:ref>            = <x:ref>OWS</x:ref>
1348                 ; "bad" whitespace
1352<section title="Field Parsing" anchor="field.parsing">
1354   Messages are parsed using a generic algorithm, independent of the
1355   individual header field names. The contents within a given field value are
1356   not parsed until a later stage of message interpretation (usually after the
1357   message's entire header section has been processed).
1358   Consequently, this specification does not use ABNF rules to define each
1359   "Field-Name: Field Value" pair, as was done in previous editions.
1360   Instead, this specification uses ABNF rules which are named according to
1361   each registered field name, wherein the rule defines the valid grammar for
1362   that field's corresponding field values (i.e., after the field-value
1363   has been extracted from the header section by a generic field parser).
1366   No whitespace is allowed between the header field-name and colon.
1367   In the past, differences in the handling of such whitespace have led to
1368   security vulnerabilities in request routing and response handling.
1369   A server &MUST; reject any received request message that contains
1370   whitespace between a header field-name and colon with a response code of
1371   <x:ref>400 (Bad Request)</x:ref>. A proxy &MUST; remove any such whitespace
1372   from a response message before forwarding the message downstream.
1375   A field value might be preceded and/or followed by optional whitespace
1376   (OWS); a single SP preceding the field-value is preferred for consistent
1377   readability by humans.
1378   The field value does not include any leading or trailing white space: OWS
1379   occurring before the first non-whitespace octet of the field value or after
1380   the last non-whitespace octet of the field value ought to be excluded by
1381   parsers when extracting the field value from a header field.
1384   Historically, HTTP header field values could be extended over multiple
1385   lines by preceding each extra line with at least one space or horizontal
1386   tab (obs-fold). This specification deprecates such line folding except
1387   within the message/http media type
1388   (<xref target=""/>).
1389   A sender &MUST-NOT; generate a message that includes line folding
1390   (i.e., that has any field-value that contains a match to the
1391   <x:ref>obs-fold</x:ref> rule) unless the message is intended for packaging
1392   within the message/http media type.
1395   A server that receives an <x:ref>obs-fold</x:ref> in a request message that
1396   is not within a message/http container &MUST; either reject the message by
1397   sending a <x:ref>400 (Bad Request)</x:ref>, preferably with a
1398   representation explaining that obsolete line folding is unacceptable, or
1399   replace each received <x:ref>obs-fold</x:ref> with one or more
1400   <x:ref>SP</x:ref> octets prior to interpreting the field value or
1401   forwarding the message downstream.
1404   A proxy or gateway that receives an <x:ref>obs-fold</x:ref> in a response
1405   message that is not within a message/http container &MUST; either discard
1406   the message and replace it with a <x:ref>502 (Bad Gateway)</x:ref>
1407   response, preferably with a representation explaining that unacceptable
1408   line folding was received, or replace each received <x:ref>obs-fold</x:ref>
1409   with one or more <x:ref>SP</x:ref> octets prior to interpreting the field
1410   value or forwarding the message downstream.
1413   A user agent that receives an <x:ref>obs-fold</x:ref> in a response message
1414   that is not within a message/http container &MUST; replace each received
1415   <x:ref>obs-fold</x:ref> with one or more <x:ref>SP</x:ref> octets prior to
1416   interpreting the field value.
1419   Historically, HTTP has allowed field content with text in the ISO-8859-1
1420   <xref target="ISO-8859-1"/> charset, supporting other charsets only
1421   through use of <xref target="RFC2047"/> encoding.
1422   In practice, most HTTP header field values use only a subset of the
1423   US-ASCII charset <xref target="USASCII"/>. Newly defined
1424   header fields &SHOULD; limit their field values to US-ASCII octets.
1425   A recipient &SHOULD; treat other octets in field content (obs-text) as
1426   opaque data.
1430<section title="Field Limits" anchor="field.limits">
1432   HTTP does not place a pre-defined limit on the length of each header field
1433   or on the length of the header section as a whole, as described in
1434   <xref target="conformance"/>. Various ad-hoc limitations on individual
1435   header field length are found in practice, often depending on the specific
1436   field semantics.
1439   A server that receives a request header field, or set of fields, larger
1440   than it wishes to process &MUST; respond with an appropriate
1441   <x:ref>4xx (Client Error)</x:ref> status code. Ignoring such header fields
1442   would increase the server's vulnerability to request smuggling attacks
1443   (<xref target="request.smuggling"/>).
1446   A client &MAY; discard or truncate received header fields that are larger
1447   than the client wishes to process if the field semantics are such that the
1448   dropped value(s) can be safely ignored without changing the
1449   message framing or response semantics.
1453<section title="Field Value Components" anchor="field.components">
1454<t anchor="rule.token.separators">
1455  <x:anchor-alias value="tchar"/>
1456  <x:anchor-alias value="token"/>
1457  <iref item="Delimiters"/>
1458   Most HTTP header field values are defined using common syntax components
1459   (token, quoted-string, and comment) separated by whitespace or specific
1460   delimiting characters. Delimiters are chosen from the set of US-ASCII
1461   visual characters not allowed in a <x:ref>token</x:ref>
1462   (DQUOTE and "(),/:;&lt;=>?@[\]{}").
1464<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="token"/><iref primary="true" item="Grammar" subitem="tchar"/>
1465  <x:ref>token</x:ref>          = 1*<x:ref>tchar</x:ref>
1467  NOTE: the definition of tchar and the prose above about special characters need to match!
1468 -->
1469  <x:ref>tchar</x:ref>          = "!" / "#" / "$" / "%" / "&amp;" / "'" / "*"
1470                 / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
1471                 / <x:ref>DIGIT</x:ref> / <x:ref>ALPHA</x:ref>
1472                 ; any <x:ref>VCHAR</x:ref>, except delimiters
1474<t anchor="rule.quoted-string">
1475  <x:anchor-alias value="quoted-string"/>
1476  <x:anchor-alias value="qdtext"/>
1477  <x:anchor-alias value="obs-text"/>
1478   A string of text is parsed as a single value if it is quoted using
1479   double-quote marks.
1481<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"/>
1482  <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>
1483  <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>
1484  <x:ref>obs-text</x:ref>       = %x80-FF
1486<t anchor="rule.comment">
1487  <x:anchor-alias value="comment"/>
1488  <x:anchor-alias value="ctext"/>
1489   Comments can be included in some HTTP header fields by surrounding
1490   the comment text with parentheses. Comments are only allowed in
1491   fields containing "comment" as part of their field value definition.
1493<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="comment"/><iref primary="true" item="Grammar" subitem="ctext"/>
1494  <x:ref>comment</x:ref>        = "(" *( <x:ref>ctext</x:ref> / <x:ref>quoted-pair</x:ref> / <x:ref>comment</x:ref> ) ")"
1495  <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>
1497<t anchor="rule.quoted-pair">
1498  <x:anchor-alias value="quoted-pair"/>
1499   The backslash octet ("\") can be used as a single-octet
1500   quoting mechanism within quoted-string and comment constructs.
1501   Recipients that process the value of a quoted-string &MUST; handle a
1502   quoted-pair as if it were replaced by the octet following the backslash.
1504<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="quoted-pair"/>
1505  <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> )
1508   A sender &SHOULD-NOT; generate a quoted-pair in a quoted-string except
1509   where necessary to quote DQUOTE and backslash octets occurring within that
1510   string.
1511   A sender &SHOULD-NOT; generate a quoted-pair in a comment except
1512   where necessary to quote parentheses ["(" and ")"] and backslash octets
1513   occurring within that comment.
1519<section title="Message Body" anchor="message.body">
1520  <x:anchor-alias value="message-body"/>
1522   The message body (if any) of an HTTP message is used to carry the
1523   payload body of that request or response.  The message body is
1524   identical to the payload body unless a transfer coding has been
1525   applied, as described in <xref target="header.transfer-encoding"/>.
1527<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="message-body"/>
1528  <x:ref>message-body</x:ref> = *OCTET
1531   The rules for when a message body is allowed in a message differ for
1532   requests and responses.
1535   The presence of a message body in a request is signaled by a
1536   <x:ref>Content-Length</x:ref> or <x:ref>Transfer-Encoding</x:ref> header
1537   field. Request message framing is independent of method semantics,
1538   even if the method does not define any use for a message body.
1541   The presence of a message body in a response depends on both
1542   the request method to which it is responding and the response
1543   status code (<xref target="status.line"/>).
1544   Responses to the HEAD request method (&HEAD;) never include a message body
1545   because the associated response header fields (e.g.,
1546   <x:ref>Transfer-Encoding</x:ref>, <x:ref>Content-Length</x:ref>, etc.),
1547   if present, indicate only what their values would have been if the request
1548   method had been GET (&GET;).
1549   <x:ref>2xx (Successful)</x:ref> responses to a CONNECT request method
1550   (&CONNECT;) switch to tunnel mode instead of having a message body.
1551   All <x:ref>1xx (Informational)</x:ref>, <x:ref>204 (No Content)</x:ref>, and
1552   <x:ref>304 (Not Modified)</x:ref> responses do not include a message body.
1553   All other responses do include a message body, although the body
1554   might be of zero length.
1557<section title="Transfer-Encoding" anchor="header.transfer-encoding">
1558  <iref primary="true" item="Transfer-Encoding header field" x:for-anchor=""/>
1559  <iref item="chunked (Coding Format)"/>
1560  <x:anchor-alias value="Transfer-Encoding"/>
1562   The Transfer-Encoding header field lists the transfer coding names
1563   corresponding to the sequence of transfer codings that have been
1564   (or will be) applied to the payload body in order to form the message body.
1565   Transfer codings are defined in <xref target="transfer.codings"/>.
1567<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Transfer-Encoding"/>
1568  <x:ref>Transfer-Encoding</x:ref> = 1#<x:ref>transfer-coding</x:ref>
1571   Transfer-Encoding is analogous to the Content-Transfer-Encoding field of
1572   MIME, which was designed to enable safe transport of binary data over a
1573   7-bit transport service (<xref target="RFC2045" x:fmt="," x:sec="6"/>).
1574   However, safe transport has a different focus for an 8bit-clean transfer
1575   protocol. In HTTP's case, Transfer-Encoding is primarily intended to
1576   accurately delimit a dynamically generated payload and to distinguish
1577   payload encodings that are only applied for transport efficiency or
1578   security from those that are characteristics of the selected resource.
1581   A recipient &MUST; be able to parse the chunked transfer coding
1582   (<xref target="chunked.encoding"/>) because it plays a crucial role in
1583   framing messages when the payload body size is not known in advance.
1584   A sender &MUST-NOT; apply chunked more than once to a message body
1585   (i.e., chunking an already chunked message is not allowed).
1586   If any transfer coding other than chunked is applied to a request payload
1587   body, the sender &MUST; apply chunked as the final transfer coding to
1588   ensure that the message is properly framed.
1589   If any transfer coding other than chunked is applied to a response payload
1590   body, the sender &MUST; either apply chunked as the final transfer coding
1591   or terminate the message by closing the connection.
1594   For example,
1595</preamble><artwork type="example">
1596  Transfer-Encoding: gzip, chunked
1598   indicates that the payload body has been compressed using the gzip
1599   coding and then chunked using the chunked coding while forming the
1600   message body.
1603   Unlike <x:ref>Content-Encoding</x:ref> (&content-codings;),
1604   Transfer-Encoding is a property of the message, not of the representation, and
1605   any recipient along the request/response chain &MAY; decode the received
1606   transfer coding(s) or apply additional transfer coding(s) to the message
1607   body, assuming that corresponding changes are made to the Transfer-Encoding
1608   field-value. Additional information about the encoding parameters can be
1609   provided by other header fields not defined by this specification.
1612   Transfer-Encoding &MAY; be sent in a response to a HEAD request or in a
1613   <x:ref>304 (Not Modified)</x:ref> response (&status-304;) to a GET request,
1614   neither of which includes a message body,
1615   to indicate that the origin server would have applied a transfer coding
1616   to the message body if the request had been an unconditional GET.
1617   This indication is not required, however, because any recipient on
1618   the response chain (including the origin server) can remove transfer
1619   codings when they are not needed.
1622   A server &MUST-NOT; send a Transfer-Encoding header field in any response
1623   with a status code of
1624   <x:ref>1xx (Informational)</x:ref> or <x:ref>204 (No Content)</x:ref>.
1625   A server &MUST-NOT; send a Transfer-Encoding header field in any
1626   <x:ref>2xx (Successful)</x:ref> response to a CONNECT request (&CONNECT;).
1629   Transfer-Encoding was added in HTTP/1.1.  It is generally assumed that
1630   implementations advertising only HTTP/1.0 support will not understand
1631   how to process a transfer-encoded payload.
1632   A client &MUST-NOT; send a request containing Transfer-Encoding unless it
1633   knows the server will handle HTTP/1.1 (or later) requests; such knowledge
1634   might be in the form of specific user configuration or by remembering the
1635   version of a prior received response.
1636   A server &MUST-NOT; send a response containing Transfer-Encoding unless
1637   the corresponding request indicates HTTP/1.1 (or later).
1640   A server that receives a request message with a transfer coding it does
1641   not understand &SHOULD; respond with <x:ref>501 (Not Implemented)</x:ref>.
1645<section title="Content-Length" anchor="header.content-length">
1646  <iref primary="true" item="Content-Length header field" x:for-anchor=""/>
1647  <x:anchor-alias value="Content-Length"/>
1649   When a message does not have a <x:ref>Transfer-Encoding</x:ref> header
1650   field, a Content-Length header field can provide the anticipated size,
1651   as a decimal number of octets, for a potential payload body.
1652   For messages that do include a payload body, the Content-Length field-value
1653   provides the framing information necessary for determining where the body
1654   (and message) ends.  For messages that do not include a payload body, the
1655   Content-Length indicates the size of the selected representation
1656   (&representation;).
1658<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Content-Length"/>
1659  <x:ref>Content-Length</x:ref> = 1*<x:ref>DIGIT</x:ref>
1662   An example is
1664<figure><artwork type="example">
1665  Content-Length: 3495
1668   A sender &MUST-NOT; send a Content-Length header field in any message that
1669   contains a <x:ref>Transfer-Encoding</x:ref> header field.
1672   A user agent &SHOULD; send a Content-Length in a request message when no
1673   <x:ref>Transfer-Encoding</x:ref> is sent and the request method defines
1674   a meaning for an enclosed payload body. For example, a Content-Length
1675   header field is normally sent in a POST request even when the value is
1676   0 (indicating an empty payload body).  A user agent &SHOULD-NOT; send a
1677   Content-Length header field when the request message does not contain a
1678   payload body and the method semantics do not anticipate such a body.
1681   A server &MAY; send a Content-Length header field in a response to a HEAD
1682   request (&HEAD;); a server &MUST-NOT; send Content-Length in such a
1683   response unless its field-value equals the decimal number of octets that
1684   would have been sent in the payload body of a response if the same
1685   request had used the GET method.
1688   A server &MAY; send a Content-Length header field in a
1689   <x:ref>304 (Not Modified)</x:ref> response to a conditional GET request
1690   (&status-304;); a server &MUST-NOT; send Content-Length in such a
1691   response unless its field-value equals the decimal number of octets that
1692   would have been sent in the payload body of a <x:ref>200 (OK)</x:ref>
1693   response to the same request.
1696   A server &MUST-NOT; send a Content-Length header field in any response
1697   with a status code of
1698   <x:ref>1xx (Informational)</x:ref> or <x:ref>204 (No Content)</x:ref>.
1699   A server &MUST-NOT; send a Content-Length header field in any
1700   <x:ref>2xx (Successful)</x:ref> response to a CONNECT request (&CONNECT;).
1703   Aside from the cases defined above, in the absence of Transfer-Encoding,
1704   an origin server &SHOULD; send a Content-Length header field when the
1705   payload body size is known prior to sending the complete header section.
1706   This will allow downstream recipients to measure transfer progress,
1707   know when a received message is complete, and potentially reuse the
1708   connection for additional requests.
1711   Any Content-Length field value greater than or equal to zero is valid.
1712   Since there is no predefined limit to the length of a payload, a
1713   recipient &MUST; anticipate potentially large decimal numerals and
1714   prevent parsing errors due to integer conversion overflows
1715   (<xref target="attack.protocol.element.length"/>).
1718   If a message is received that has multiple Content-Length header fields
1719   with field-values consisting of the same decimal value, or a single
1720   Content-Length header field with a field value containing a list of
1721   identical decimal values (e.g., "Content-Length: 42, 42"), indicating that
1722   duplicate Content-Length header fields have been generated or combined by an
1723   upstream message processor, then the recipient &MUST; either reject the
1724   message as invalid or replace the duplicated field-values with a single
1725   valid Content-Length field containing that decimal value prior to
1726   determining the message body length or forwarding the message.
1729  <t>
1730   &Note; HTTP's use of Content-Length for message framing differs
1731   significantly from the same field's use in MIME, where it is an optional
1732   field used only within the "message/external-body" media-type.
1733  </t>
1737<section title="Message Body Length" anchor="message.body.length">
1738  <iref item="chunked (Coding Format)"/>
1740   The length of a message body is determined by one of the following
1741   (in order of precedence):
1744  <list style="numbers">
1745    <x:lt><t>
1746     Any response to a HEAD request and any response with a
1747     <x:ref>1xx (Informational)</x:ref>, <x:ref>204 (No Content)</x:ref>, or
1748     <x:ref>304 (Not Modified)</x:ref> status code is always
1749     terminated by the first empty line after the header fields, regardless of
1750     the header fields present in the message, and thus cannot contain a
1751     message body.
1752    </t></x:lt>
1753    <x:lt><t>
1754     Any <x:ref>2xx (Successful)</x:ref> response to a CONNECT request implies that the
1755     connection will become a tunnel immediately after the empty line that
1756     concludes the header fields.  A client &MUST; ignore any
1757     <x:ref>Content-Length</x:ref> or <x:ref>Transfer-Encoding</x:ref> header
1758     fields received in such a message.
1759    </t></x:lt>
1760    <x:lt><t>
1761     If a <x:ref>Transfer-Encoding</x:ref> header field is present
1762     and the chunked transfer coding (<xref target="chunked.encoding"/>)
1763     is the final encoding, the message body length is determined by reading
1764     and decoding the chunked data until the transfer coding indicates the
1765     data is complete.
1766    </t>
1767    <t>
1768     If a <x:ref>Transfer-Encoding</x:ref> header field is present in a
1769     response and the chunked transfer coding is not the final encoding, the
1770     message body length is determined by reading the connection until it is
1771     closed by the server.
1772     If a <x:ref>Transfer-Encoding</x:ref> header field is present in a request and the
1773     chunked transfer coding is not the final encoding, the message body
1774     length cannot be determined reliably; the server &MUST; respond with
1775     the <x:ref>400 (Bad Request)</x:ref> status code and then close the connection.
1776    </t>
1777    <t>
1778     If a message is received with both a <x:ref>Transfer-Encoding</x:ref>
1779     and a <x:ref>Content-Length</x:ref> header field, the Transfer-Encoding
1780     overrides the Content-Length. Such a message might indicate an attempt to
1781     perform request smuggling (<xref target="request.smuggling"/>) or
1782     response splitting (<xref target="response.splitting"/>) and ought to be
1783     handled as an error. A sender &MUST; remove the received Content-Length
1784     field prior to forwarding such a message downstream.
1785    </t></x:lt>
1786    <x:lt><t>
1787     If a message is received without <x:ref>Transfer-Encoding</x:ref> and with
1788     either multiple <x:ref>Content-Length</x:ref> header fields having
1789     differing field-values or a single Content-Length header field having an
1790     invalid value, then the message framing is invalid and
1791     the recipient &MUST; treat it as an unrecoverable error.
1792     If this is a request message, the server &MUST; respond with
1793     a <x:ref>400 (Bad Request)</x:ref> status code and then close the connection.
1794     If this is a response message received by a proxy,
1795     the proxy &MUST; close the connection to the server, discard the received
1796     response, and send a <x:ref>502 (Bad Gateway)</x:ref> response to the
1797     client.
1798     If this is a response message received by a user agent,
1799     the user agent &MUST; close the connection to the server and discard the
1800     received response.
1801    </t></x:lt>
1802    <x:lt><t>
1803     If a valid <x:ref>Content-Length</x:ref> header field is present without
1804     <x:ref>Transfer-Encoding</x:ref>, its decimal value defines the
1805     expected message body length in octets.
1806     If the sender closes the connection or the recipient times out before the
1807     indicated number of octets are received, the recipient &MUST; consider
1808     the message to be incomplete and close the connection.
1809    </t></x:lt>
1810    <x:lt><t>
1811     If this is a request message and none of the above are true, then the
1812     message body length is zero (no message body is present).
1813    </t></x:lt>
1814    <x:lt><t>
1815     Otherwise, this is a response message without a declared message body
1816     length, so the message body length is determined by the number of octets
1817     received prior to the server closing the connection.
1818    </t></x:lt>
1819  </list>
1822   Since there is no way to distinguish a successfully completed,
1823   close-delimited message from a partially-received message interrupted
1824   by network failure, a server &SHOULD; generate encoding or
1825   length-delimited messages whenever possible.  The close-delimiting
1826   feature exists primarily for backwards compatibility with HTTP/1.0.
1829   A server &MAY; reject a request that contains a message body but
1830   not a <x:ref>Content-Length</x:ref> by responding with
1831   <x:ref>411 (Length Required)</x:ref>.
1834   Unless a transfer coding other than chunked has been applied,
1835   a client that sends a request containing a message body &SHOULD;
1836   use a valid <x:ref>Content-Length</x:ref> header field if the message body
1837   length is known in advance, rather than the chunked transfer coding, since some
1838   existing services respond to chunked with a <x:ref>411 (Length Required)</x:ref>
1839   status code even though they understand the chunked transfer coding.  This
1840   is typically because such services are implemented via a gateway that
1841   requires a content-length in advance of being called and the server
1842   is unable or unwilling to buffer the entire request before processing.
1845   A user agent that sends a request containing a message body &MUST; send a
1846   valid <x:ref>Content-Length</x:ref> header field if it does not know the
1847   server will handle HTTP/1.1 (or later) requests; such knowledge can be in
1848   the form of specific user configuration or by remembering the version of a
1849   prior received response.
1852   If the final response to the last request on a connection has been
1853   completely received and there remains additional data to read, a user agent
1854   &MAY; discard the remaining data or attempt to determine if that data
1855   belongs as part of the prior response body, which might be the case if the
1856   prior message's Content-Length value is incorrect. A client &MUST-NOT;
1857   process, cache, or forward such extra data as a separate response, since
1858   such behavior would be vulnerable to cache poisoning.
1863<section anchor="incomplete.messages" title="Handling Incomplete Messages">
1865   A server that receives an incomplete request message, usually due to a
1866   canceled request or a triggered time-out exception, &MAY; send an error
1867   response prior to closing the connection.
1870   A client that receives an incomplete response message, which can occur
1871   when a connection is closed prematurely or when decoding a supposedly
1872   chunked transfer coding fails, &MUST; record the message as incomplete.
1873   Cache requirements for incomplete responses are defined in
1874   &cache-incomplete;.
1877   If a response terminates in the middle of the header section (before the
1878   empty line is received) and the status code might rely on header fields to
1879   convey the full meaning of the response, then the client cannot assume
1880   that meaning has been conveyed; the client might need to repeat the
1881   request in order to determine what action to take next.
1884   A message body that uses the chunked transfer coding is
1885   incomplete if the zero-sized chunk that terminates the encoding has not
1886   been received.  A message that uses a valid <x:ref>Content-Length</x:ref> is
1887   incomplete if the size of the message body received (in octets) is less than
1888   the value given by Content-Length.  A response that has neither chunked
1889   transfer coding nor Content-Length is terminated by closure of the
1890   connection and, thus, is considered complete regardless of the number of
1891   message body octets received, provided that the header section was received
1892   intact.
1896<section title="Message Parsing Robustness" anchor="message.robustness">
1898   Older HTTP/1.0 user agent implementations might send an extra CRLF
1899   after a POST request as a workaround for some early server
1900   applications that failed to read message body content that was
1901   not terminated by a line-ending. An HTTP/1.1 user agent &MUST-NOT;
1902   preface or follow a request with an extra CRLF.  If terminating
1903   the request message body with a line-ending is desired, then the
1904   user agent &MUST; count the terminating CRLF octets as part of the
1905   message body length.
1908   In the interest of robustness, a server that is expecting to receive and
1909   parse a request-line &SHOULD; ignore at least one empty line (CRLF)
1910   received prior to the request-line.
1913   Although the line terminator for the start-line and header
1914   fields is the sequence CRLF, a recipient &MAY; recognize a
1915   single LF as a line terminator and ignore any preceding CR.
1918   Although the request-line and status-line grammar rules require that each
1919   of the component elements be separated by a single SP octet, recipients
1920   &MAY; instead parse on whitespace-delimited word boundaries and, aside
1921   from the CRLF terminator, treat any form of whitespace as the SP separator
1922   while ignoring preceding or trailing whitespace;
1923   such whitespace includes one or more of the following octets:
1924   SP, HTAB, VT (%x0B), FF (%x0C), or bare CR.
1925   However, lenient parsing can result in security vulnerabilities if there
1926   are multiple recipients of the message and each has its own unique
1927   interpretation of robustness (see <xref target="request.smuggling"/>).
1930   When a server listening only for HTTP request messages, or processing
1931   what appears from the start-line to be an HTTP request message,
1932   receives a sequence of octets that does not match the HTTP-message
1933   grammar aside from the robustness exceptions listed above, the
1934   server &SHOULD; respond with a <x:ref>400 (Bad Request)</x:ref> response. 
1939<section title="Transfer Codings" anchor="transfer.codings">
1940  <x:anchor-alias value="transfer-coding"/>
1941  <x:anchor-alias value="transfer-extension"/>
1943   Transfer coding names are used to indicate an encoding
1944   transformation that has been, can be, or might need to be applied to a
1945   payload body in order to ensure "safe transport" through the network.
1946   This differs from a content coding in that the transfer coding is a
1947   property of the message rather than a property of the representation
1948   that is being transferred.
1950<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="transfer-coding"/><iref primary="true" item="Grammar" subitem="transfer-extension"/>
1951  <x:ref>transfer-coding</x:ref>    = "chunked" ; <xref target="chunked.encoding"/>
1952                     / "compress" ; <xref target="compress.coding"/>
1953                     / "deflate" ; <xref target="deflate.coding"/>
1954                     / "gzip" ; <xref target="gzip.coding"/>
1955                     / <x:ref>transfer-extension</x:ref>
1956  <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> )
1958<t anchor="rule.parameter">
1959  <x:anchor-alias value="transfer-parameter"/>
1960   Parameters are in the form of a name or name=value pair.
1962<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="transfer-parameter"/>
1963  <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> )
1966   All transfer-coding names are case-insensitive and ought to be registered
1967   within the HTTP Transfer Coding registry, as defined in
1968   <xref target="transfer.coding.registry"/>.
1969   They are used in the <x:ref>TE</x:ref> (<xref target="header.te"/>) and
1970   <x:ref>Transfer-Encoding</x:ref> (<xref target="header.transfer-encoding"/>)
1971   header fields.
1974<section title="Chunked Transfer Coding" anchor="chunked.encoding">
1975  <iref primary="true" item="chunked (Coding Format)"/>
1976  <x:anchor-alias value="chunk"/>
1977  <x:anchor-alias value="chunked-body"/>
1978  <x:anchor-alias value="chunk-data"/>
1979  <x:anchor-alias value="chunk-size"/>
1980  <x:anchor-alias value="last-chunk"/>
1982   The chunked transfer coding wraps the payload body in order to transfer it
1983   as a series of chunks, each with its own size indicator, followed by an
1984   &OPTIONAL; trailer containing header fields. Chunked enables content
1985   streams of unknown size to be transferred as a sequence of length-delimited
1986   buffers, which enables the sender to retain connection persistence and the
1987   recipient to know when it has received the entire message.
1989<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"/>
1990  <x:ref>chunked-body</x:ref>   = *<x:ref>chunk</x:ref>
1991                   <x:ref>last-chunk</x:ref>
1992                   <x:ref>trailer-part</x:ref>
1993                   <x:ref>CRLF</x:ref>
1995  <x:ref>chunk</x:ref>          = <x:ref>chunk-size</x:ref> [ <x:ref>chunk-ext</x:ref> ] <x:ref>CRLF</x:ref>
1996                   <x:ref>chunk-data</x:ref> <x:ref>CRLF</x:ref>
1997  <x:ref>chunk-size</x:ref>     = 1*<x:ref>HEXDIG</x:ref>
1998  <x:ref>last-chunk</x:ref>     = 1*("0") [ <x:ref>chunk-ext</x:ref> ] <x:ref>CRLF</x:ref>
2000  <x:ref>chunk-data</x:ref>     = 1*<x:ref>OCTET</x:ref> ; a sequence of chunk-size octets
2003   The chunk-size field is a string of hex digits indicating the size of
2004   the chunk-data in octets. The chunked transfer coding is complete when a
2005   chunk with a chunk-size of zero is received, possibly followed by a
2006   trailer, and finally terminated by an empty line.
2009   A recipient &MUST; be able to parse and decode the chunked transfer coding.
2012<section title="Chunk Extensions" anchor="chunked.extension">
2013  <x:anchor-alias value="chunk-ext"/>
2014  <x:anchor-alias value="chunk-ext-name"/>
2015  <x:anchor-alias value="chunk-ext-val"/>
2017   The chunked encoding allows each chunk to include zero or more chunk
2018   extensions, immediately following the <x:ref>chunk-size</x:ref>, for the
2019   sake of supplying per-chunk metadata (such as a signature or hash),
2020   mid-message control information, or randomization of message body size.
2022<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"/>
2023  <x:ref>chunk-ext</x:ref>      = *( ";" <x:ref>chunk-ext-name</x:ref> [ "=" <x:ref>chunk-ext-val</x:ref> ] )
2025  <x:ref>chunk-ext-name</x:ref> = <x:ref>token</x:ref>
2026  <x:ref>chunk-ext-val</x:ref>  = <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref>
2029   The chunked encoding is specific to each connection and is likely to be
2030   removed or recoded by each recipient (including intermediaries) before any
2031   higher-level application would have a chance to inspect the extensions.
2032   Hence, use of chunk extensions is generally limited to specialized HTTP
2033   services such as "long polling" (where client and server can have shared
2034   expectations regarding the use of chunk extensions) or for padding within
2035   an end-to-end secured connection.
2038   A recipient &MUST; ignore unrecognized chunk extensions.
2039   A server ought to limit the total length of chunk extensions received in a
2040   request to an amount reasonable for the services provided, in the same way
2041   that it applies length limitations and timeouts for other parts of a
2042   message, and generate an appropriate <x:ref>4xx (Client Error)</x:ref>
2043   response if that amount is exceeded.
2047<section title="Chunked Trailer Part" anchor="chunked.trailer.part">
2048  <x:anchor-alias value="trailer-part"/>
2050   A trailer allows the sender to include additional fields at the end of a
2051   chunked message in order to supply metadata that might be dynamically
2052   generated while the message body is sent, such as a message integrity
2053   check, digital signature, or post-processing status. The trailer fields are
2054   identical to header fields, except they are sent in a chunked trailer
2055   instead of the message's header section.
2057<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="trailer-part"/><iref primary="false" item="Grammar" subitem="header-field"/>
2058  <x:ref>trailer-part</x:ref>   = *( <x:ref>header-field</x:ref> <x:ref>CRLF</x:ref> )
2061   A sender &MUST-NOT; generate a trailer that contains a field necessary for
2062   message framing (e.g., <x:ref>Transfer-Encoding</x:ref> and
2063   <x:ref>Content-Length</x:ref>), routing (e.g., <x:ref>Host</x:ref>),
2064   request modifiers (e.g., controls and conditionals in
2065   &request-header-fields;), authentication (e.g., see <xref target="RFC7235"/>
2066   and <xref target="RFC6265"/>), response control data (e.g., see
2067   &response-control-data;), or determining how to process the payload
2068   (e.g., <x:ref>Content-Encoding</x:ref>, <x:ref>Content-Type</x:ref>,
2069   <x:ref>Content-Range</x:ref>, and <x:ref>Trailer</x:ref>).
2072   When a chunked message containing a non-empty trailer is received, the
2073   recipient &MAY; process the fields (aside from those forbidden above)
2074   as if they were appended to the message's header section.
2075   A recipient &MUST; ignore (or consider as an error) any fields that are
2076   forbidden to be sent in a trailer, since processing them as if they were
2077   present in the header section might bypass external security filters.
2080   Unless the request includes a <x:ref>TE</x:ref> header field indicating
2081   "trailers" is acceptable, as described in <xref target="header.te"/>, a
2082   server &SHOULD-NOT; generate trailer fields that it believes are necessary
2083   for the user agent to receive. Without a TE containing "trailers", the
2084   server ought to assume that the trailer fields might be silently discarded
2085   along the path to the user agent. This requirement allows intermediaries to
2086   forward a de-chunked message to an HTTP/1.0 recipient without buffering the
2087   entire response.
2091<section title="Decoding Chunked" anchor="decoding.chunked">
2093   A process for decoding the chunked transfer coding
2094   can be represented in pseudo-code as:
2096<figure><artwork type="code">
2097  length := 0
2098  read chunk-size, chunk-ext (if any), and CRLF
2099  while (chunk-size &gt; 0) {
2100     read chunk-data and CRLF
2101     append chunk-data to decoded-body
2102     length := length + chunk-size
2103     read chunk-size, chunk-ext (if any), and CRLF
2104  }
2105  read trailer field
2106  while (trailer field is not empty) {
2107     if (trailer field is allowed to be sent in a trailer) {
2108         append trailer field to existing header fields
2109     }
2110     read trailer-field
2111  }
2112  Content-Length := length
2113  Remove "chunked" from Transfer-Encoding
2114  Remove Trailer from existing header fields
2119<section title="Compression Codings" anchor="compression.codings">
2121   The codings defined below can be used to compress the payload of a
2122   message.
2125<section title="Compress Coding" anchor="compress.coding">
2126<iref item="compress (Coding Format)"/>
2128   The "compress" coding is an adaptive Lempel-Ziv-Welch (LZW) coding
2129   <xref target="Welch"/> that is commonly produced by the UNIX file
2130   compression program "compress".
2131   A recipient &SHOULD; consider "x-compress" to be equivalent to "compress".
2135<section title="Deflate Coding" anchor="deflate.coding">
2136<iref item="deflate (Coding Format)"/>
2138   The "deflate" coding is a "zlib" data format <xref target="RFC1950"/>
2139   containing a "deflate" compressed data stream <xref target="RFC1951"/>
2140   that uses a combination of the Lempel-Ziv (LZ77) compression algorithm and
2141   Huffman coding.
2144  <t>
2145    &Note; Some non-conformant implementations send the "deflate"
2146    compressed data without the zlib wrapper.
2147   </t>
2151<section title="Gzip Coding" anchor="gzip.coding">
2152<iref item="gzip (Coding Format)"/>
2154   The "gzip" coding is an LZ77 coding with a 32 bit CRC that is commonly
2155   produced by the gzip file compression program <xref target="RFC1952"/>.
2156   A recipient &SHOULD; consider "x-gzip" to be equivalent to "gzip".
2162<section title="TE" anchor="header.te">
2163  <iref primary="true" item="TE header field" x:for-anchor=""/>
2164  <x:anchor-alias value="TE"/>
2165  <x:anchor-alias value="t-codings"/>
2166  <x:anchor-alias value="t-ranking"/>
2167  <x:anchor-alias value="rank"/>
2169   The "TE" header field in a request indicates what transfer codings,
2170   besides chunked, the client is willing to accept in response, and
2171   whether or not the client is willing to accept trailer fields in a
2172   chunked transfer coding.
2175   The TE field-value consists of a comma-separated list of transfer coding
2176   names, each allowing for optional parameters (as described in
2177   <xref target="transfer.codings"/>), and/or the keyword "trailers".
2178   A client &MUST-NOT; send the chunked transfer coding name in TE;
2179   chunked is always acceptable for HTTP/1.1 recipients.
2181<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"/>
2182  <x:ref>TE</x:ref>        = #<x:ref>t-codings</x:ref>
2183  <x:ref>t-codings</x:ref> = "trailers" / ( <x:ref>transfer-coding</x:ref> [ <x:ref>t-ranking</x:ref> ] )
2184  <x:ref>t-ranking</x:ref> = <x:ref>OWS</x:ref> ";" <x:ref>OWS</x:ref> "q=" <x:ref>rank</x:ref>
2185  <x:ref>rank</x:ref>      = ( "0" [ "." 0*3<x:ref>DIGIT</x:ref> ] )
2186             / ( "1" [ "." 0*3("0") ] )
2189   Three examples of TE use are below.
2191<figure><artwork type="example">
2192  TE: deflate
2193  TE:
2194  TE: trailers, deflate;q=0.5
2197   The presence of the keyword "trailers" indicates that the client is willing
2198   to accept trailer fields in a chunked transfer coding, as defined in
2199   <xref target="chunked.trailer.part"/>, on behalf of itself and any downstream
2200   clients. For requests from an intermediary, this implies that either:
2201   (a) all downstream clients are willing to accept trailer fields in the
2202   forwarded response; or,
2203   (b) the intermediary will attempt to buffer the response on behalf of
2204   downstream recipients.
2205   Note that HTTP/1.1 does not define any means to limit the size of a
2206   chunked response such that an intermediary can be assured of buffering the
2207   entire response.
2210   When multiple transfer codings are acceptable, the client &MAY; rank the
2211   codings by preference using a case-insensitive "q" parameter (similar to
2212   the qvalues used in content negotiation fields, &qvalue;). The rank value
2213   is a real number in the range 0 through 1, where 0.001 is the least
2214   preferred and 1 is the most preferred; a value of 0 means "not acceptable".
2217   If the TE field-value is empty or if no TE field is present, the only
2218   acceptable transfer coding is chunked. A message with no transfer coding
2219   is always acceptable.
2222   Since the TE header field only applies to the immediate connection,
2223   a sender of TE &MUST; also send a "TE" connection option within the
2224   <x:ref>Connection</x:ref> header field (<xref target="header.connection"/>)
2225   in order to prevent the TE field from being forwarded by intermediaries
2226   that do not support its semantics.
2230<section title="Trailer" anchor="header.trailer">
2231  <iref primary="true" item="Trailer header field" x:for-anchor=""/>
2232  <x:anchor-alias value="Trailer"/>
2234   When a message includes a message body encoded with the chunked
2235   transfer coding and the sender desires to send metadata in the form of
2236   trailer fields at the end of the message, the sender &SHOULD; generate a
2237   <x:ref>Trailer</x:ref> header field before the message body to indicate
2238   which fields will be present in the trailers. This allows the recipient
2239   to prepare for receipt of that metadata before it starts processing the body,
2240   which is useful if the message is being streamed and the recipient wishes
2241   to confirm an integrity check on the fly.
2243<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Trailer"/><iref primary="false" item="Grammar" subitem="field-name"/>
2244  <x:ref>Trailer</x:ref> = 1#<x:ref>field-name</x:ref>
2249<section title="Message Routing" anchor="message.routing">
2251   HTTP request message routing is determined by each client based on the
2252   target resource, the client's proxy configuration, and
2253   establishment or reuse of an inbound connection.  The corresponding
2254   response routing follows the same connection chain back to the client.
2257<section title="Identifying a Target Resource" anchor="target-resource">
2258  <iref primary="true" item="target resource"/>
2259  <iref primary="true" item="target URI"/>
2260  <x:anchor-alias value="target resource"/>
2261  <x:anchor-alias value="target URI"/>
2263   HTTP is used in a wide variety of applications, ranging from
2264   general-purpose computers to home appliances.  In some cases,
2265   communication options are hard-coded in a client's configuration.
2266   However, most HTTP clients rely on the same resource identification
2267   mechanism and configuration techniques as general-purpose Web browsers.
2270   HTTP communication is initiated by a user agent for some purpose.
2271   The purpose is a combination of request semantics, which are defined in
2272   <xref target="RFC7231"/>, and a target resource upon which to apply those
2273   semantics.  A URI reference (<xref target="uri"/>) is typically used as
2274   an identifier for the "<x:dfn>target resource</x:dfn>", which a user agent
2275   would resolve to its absolute form in order to obtain the
2276   "<x:dfn>target URI</x:dfn>".  The target URI
2277   excludes the reference's fragment component, if any,
2278   since fragment identifiers are reserved for client-side processing
2279   (<xref target="RFC3986" x:fmt="," x:sec="3.5"/>).
2283<section title="Connecting Inbound" anchor="connecting.inbound">
2285   Once the target URI is determined, a client needs to decide whether
2286   a network request is necessary to accomplish the desired semantics and,
2287   if so, where that request is to be directed.
2290   If the client has a cache <xref target="RFC7234"/> and the request can be
2291   satisfied by it, then the request is
2292   usually directed there first.
2295   If the request is not satisfied by a cache, then a typical client will
2296   check its configuration to determine whether a proxy is to be used to
2297   satisfy the request.  Proxy configuration is implementation-dependent,
2298   but is often based on URI prefix matching, selective authority matching,
2299   or both, and the proxy itself is usually identified by an "http" or
2300   "https" URI.  If a proxy is applicable, the client connects inbound by
2301   establishing (or reusing) a connection to that proxy.
2304   If no proxy is applicable, a typical client will invoke a handler routine,
2305   usually specific to the target URI's scheme, to connect directly
2306   to an authority for the target resource.  How that is accomplished is
2307   dependent on the target URI scheme and defined by its associated
2308   specification, similar to how this specification defines origin server
2309   access for resolution of the "http" (<xref target="http.uri"/>) and
2310   "https" (<xref target="https.uri"/>) schemes.
2313   HTTP requirements regarding connection management are defined in
2314   <xref target=""/>.
2318<section title="Request Target" anchor="request-target">
2320   Once an inbound connection is obtained,
2321   the client sends an HTTP request message (<xref target="http.message"/>)
2322   with a request-target derived from the target URI.
2323   There are four distinct formats for the request-target, depending on both
2324   the method being requested and whether the request is to a proxy.
2326<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"/>
2327  <x:ref>request-target</x:ref> = <x:ref>origin-form</x:ref>
2328                 / <x:ref>absolute-form</x:ref>
2329                 / <x:ref>authority-form</x:ref>
2330                 / <x:ref>asterisk-form</x:ref>
2333<section title="origin-form" anchor="origin-form">
2334   <iref item="origin-form (of request-target)"/>
2336   The most common form of request-target is the <x:dfn>origin-form</x:dfn>.
2338<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="origin-form"/>
2339  <x:ref>origin-form</x:ref>    = <x:ref>absolute-path</x:ref> [ "?" <x:ref>query</x:ref> ]
2342   When making a request directly to an origin server, other than a CONNECT
2343   or server-wide OPTIONS request (as detailed below),
2344   a client &MUST; send only the absolute path and query components of
2345   the target URI as the request-target.
2346   If the target URI's path component is empty, the client &MUST; send
2347   "/" as the path within the origin-form of request-target.
2348   A <x:ref>Host</x:ref> header field is also sent, as defined in
2349   <xref target=""/>.
2352   For example, a client wishing to retrieve a representation of the resource
2353   identified as
2355<figure><artwork x:indent-with="  " type="example">
2359   directly from the origin server would open (or reuse) a TCP connection
2360   to port 80 of the host "" and send the lines:
2362<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2363GET /where?q=now HTTP/1.1
2367   followed by the remainder of the request message.
2371<section title="absolute-form" anchor="absolute-form">
2372   <iref item="absolute-form (of request-target)"/>
2374   When making a request to a proxy, other than a CONNECT or server-wide
2375   OPTIONS request (as detailed below), a client &MUST; send the target URI
2376   in <x:dfn>absolute-form</x:dfn> as the request-target.
2378<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="absolute-form"/>
2379  <x:ref>absolute-form</x:ref>  = <x:ref>absolute-URI</x:ref>
2382   The proxy is requested to either service that request from a valid cache,
2383   if possible, or make the same request on the client's behalf to either
2384   the next inbound proxy server or directly to the origin server indicated
2385   by the request-target.  Requirements on such "forwarding" of messages are
2386   defined in <xref target="message.forwarding"/>.
2389   An example absolute-form of request-line would be:
2391<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2392GET HTTP/1.1
2395   To allow for transition to the absolute-form for all requests in some
2396   future version of HTTP, a server &MUST; accept the absolute-form
2397   in requests, even though HTTP/1.1 clients will only send them in requests
2398   to proxies.
2402<section title="authority-form" anchor="authority-form">
2403   <iref item="authority-form (of request-target)"/>
2405   The <x:dfn>authority-form</x:dfn> of request-target is only used for
2406   CONNECT requests (&CONNECT;).
2408<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="authority-form"/>
2409  <x:ref>authority-form</x:ref> = <x:ref>authority</x:ref>
2412   When making a CONNECT request to establish a
2413   tunnel through one or more proxies, a client &MUST; send only the target
2414   URI's authority component (excluding any userinfo and its "@" delimiter) as
2415   the request-target. For example,
2417<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2422<section title="asterisk-form" anchor="asterisk-form">
2423   <iref item="asterisk-form (of request-target)"/>
2425   The <x:dfn>asterisk-form</x:dfn> of request-target is only used for a server-wide
2426   OPTIONS request (&OPTIONS;).
2428<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="asterisk-form"/>
2429  <x:ref>asterisk-form</x:ref>  = "*"
2432   When a client wishes to request OPTIONS
2433   for the server as a whole, as opposed to a specific named resource of
2434   that server, the client &MUST; send only "*" (%x2A) as the request-target.
2435   For example,
2437<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2438OPTIONS * HTTP/1.1
2441   If a proxy receives an OPTIONS request with an absolute-form of
2442   request-target in which the URI has an empty path and no query component,
2443   then the last proxy on the request chain &MUST; send a request-target
2444   of "*" when it forwards the request to the indicated origin server.
2447   For example, the request
2448</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2452  would be forwarded by the final proxy as
2453</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2454OPTIONS * HTTP/1.1
2458   after connecting to port 8001 of host "".
2464<section title="Host" anchor="">
2465  <iref primary="true" item="Host header field" x:for-anchor=""/>
2466  <x:anchor-alias value="Host"/>
2468   The "Host" header field in a request provides the host and port
2469   information from the target URI, enabling the origin
2470   server to distinguish among resources while servicing requests
2471   for multiple host names on a single IP address.
2473<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Host"/>
2474  <x:ref>Host</x:ref> = <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ] ; <xref target="http.uri"/>
2477   A client &MUST; send a Host header field in all HTTP/1.1 request messages.
2478   If the target URI includes an authority component, then a client &MUST;
2479   send a field-value for Host that is identical to that authority
2480   component, excluding any userinfo subcomponent and its "@" delimiter
2481   (<xref target="http.uri"/>).
2482   If the authority component is missing or undefined for the target URI,
2483   then a client &MUST; send a Host header field with an empty field-value.
2486   Since the Host field-value is critical information for handling a request,
2487   a user agent &SHOULD; generate Host as the first header field following the
2488   request-line.
2491   For example, a GET request to the origin server for
2492   &lt;; would begin with:
2494<figure><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
2495GET /pub/WWW/ HTTP/1.1
2499   A client &MUST; send a Host header field in an HTTP/1.1 request even
2500   if the request-target is in the absolute-form, since this
2501   allows the Host information to be forwarded through ancient HTTP/1.0
2502   proxies that might not have implemented Host.
2505   When a proxy receives a request with an absolute-form of
2506   request-target, the proxy &MUST; ignore the received
2507   Host header field (if any) and instead replace it with the host
2508   information of the request-target.  A proxy that forwards such a request
2509   &MUST; generate a new Host field-value based on the received
2510   request-target rather than forward the received Host field-value.
2513   Since the Host header field acts as an application-level routing
2514   mechanism, it is a frequent target for malware seeking to poison
2515   a shared cache or redirect a request to an unintended server.
2516   An interception proxy is particularly vulnerable if it relies on
2517   the Host field-value for redirecting requests to internal
2518   servers, or for use as a cache key in a shared cache, without
2519   first verifying that the intercepted connection is targeting a
2520   valid IP address for that host.
2523   A server &MUST; respond with a <x:ref>400 (Bad Request)</x:ref> status code
2524   to any HTTP/1.1 request message that lacks a Host header field and
2525   to any request message that contains more than one Host header field
2526   or a Host header field with an invalid field-value.
2530<section title="Effective Request URI" anchor="effective.request.uri">
2531  <iref primary="true" item="effective request URI"/>
2532  <x:anchor-alias value="effective request URI"/>
2534   Since the request-target often contains only part of the user agent's
2535   target URI, a server reconstructs the intended target as an
2536   "<x:dfn>effective request URI</x:dfn>" to properly service the request.
2537   This reconstruction involves both the server's local configuration and
2538   information communicated in the <x:ref>request-target</x:ref>,
2539   <x:ref>Host</x:ref> header field, and connection context.
2542   For a user agent, the effective request URI is the target URI.
2545   If the <x:ref>request-target</x:ref> is in <x:ref>absolute-form</x:ref>,
2546   the effective request URI is the same as the request-target. Otherwise, the
2547   effective request URI is constructed as follows:
2548<list style="empty">
2550   If the server's configuration (or outbound gateway) provides a fixed URI
2551   <x:ref>scheme</x:ref>, that scheme is used for the effective request URI.
2552   Otherwise, if the request is received over a TLS-secured TCP connection,
2553   the effective request URI's scheme is "https"; if not, the scheme is "http".
2556   If the server's configuration (or outbound gateway) provides a fixed URI
2557   <x:ref>authority</x:ref> component, that authority is used for the
2558   effective request URI. If not, then if the request-target is in
2559   <x:ref>authority-form</x:ref>, the effective request URI's authority
2560   component is the same as the request-target.
2561   If not, then if a <x:ref>Host</x:ref> header field is supplied with a
2562   non-empty field-value, the authority component is the same as the
2563   Host field-value. Otherwise, the authority component is assigned
2564   the default name configured for the server and, if the connection's
2565   incoming TCP port number differs from the default port for the effective
2566   request URI's scheme, then a colon (":") and the incoming port number (in
2567   decimal form) are appended to the authority component.
2570   If the request-target is in <x:ref>authority-form</x:ref> or
2571   <x:ref>asterisk-form</x:ref>, the effective request URI's combined
2572   <x:ref>path</x:ref> and <x:ref>query</x:ref> component is empty. Otherwise,
2573   the combined <x:ref>path</x:ref> and <x:ref>query</x:ref> component is the
2574   same as the request-target.
2577   The components of the effective request URI, once determined as above, can
2578   be combined into <x:ref>absolute-URI</x:ref> form by concatenating the
2579   scheme, "://", authority, and combined path and query component.
2585   Example 1: the following message received over an insecure TCP connection
2587<artwork type="example" x:indent-with="  ">
2588GET /pub/WWW/TheProject.html HTTP/1.1
2594  has an effective request URI of
2596<artwork type="example" x:indent-with="  ">
2602   Example 2: the following message received over a TLS-secured TCP connection
2604<artwork type="example" x:indent-with="  ">
2605OPTIONS * HTTP/1.1
2611  has an effective request URI of
2613<artwork type="example" x:indent-with="  ">
2618   Recipients of an HTTP/1.0 request that lacks a <x:ref>Host</x:ref> header
2619   field might need to use heuristics (e.g., examination of the URI path for
2620   something unique to a particular host) in order to guess the
2621   effective request URI's authority component.
2624   Once the effective request URI has been constructed, an origin server needs
2625   to decide whether or not to provide service for that URI via the connection
2626   in which the request was received. For example, the request might have been
2627   misdirected, deliberately or accidentally, such that the information within
2628   a received <x:ref>request-target</x:ref> or <x:ref>Host</x:ref> header
2629   field differs from the host or port upon which the connection has been
2630   made. If the connection is from a trusted gateway, that inconsistency might
2631   be expected; otherwise, it might indicate an attempt to bypass security
2632   filters, trick the server into delivering non-public content, or poison a
2633   cache. See <xref target="security.considerations"/> for security
2634   considerations regarding message routing.
2638<section title="Associating a Response to a Request" anchor="">
2640   HTTP does not include a request identifier for associating a given
2641   request message with its corresponding one or more response messages.
2642   Hence, it relies on the order of response arrival to correspond exactly
2643   to the order in which requests are made on the same connection.
2644   More than one response message per request only occurs when one or more
2645   informational responses (<x:ref>1xx</x:ref>, see &status-1xx;) precede a
2646   final response to the same request.
2649   A client that has more than one outstanding request on a connection &MUST;
2650   maintain a list of outstanding requests in the order sent and &MUST;
2651   associate each received response message on that connection to the highest
2652   ordered request that has not yet received a final (non-<x:ref>1xx</x:ref>)
2653   response.
2657<section title="Message Forwarding" anchor="message.forwarding">
2659   As described in <xref target="intermediaries"/>, intermediaries can serve
2660   a variety of roles in the processing of HTTP requests and responses.
2661   Some intermediaries are used to improve performance or availability.
2662   Others are used for access control or to filter content.
2663   Since an HTTP stream has characteristics similar to a pipe-and-filter
2664   architecture, there are no inherent limits to the extent an intermediary
2665   can enhance (or interfere) with either direction of the stream.
2668   An intermediary not acting as a tunnel &MUST; implement the
2669   <x:ref>Connection</x:ref> header field, as specified in
2670   <xref target="header.connection"/>, and exclude fields from being forwarded
2671   that are only intended for the incoming connection.
2674   An intermediary &MUST-NOT; forward a message to itself unless it is
2675   protected from an infinite request loop. In general, an intermediary ought
2676   to recognize its own server names, including any aliases, local variations,
2677   or literal IP addresses, and respond to such requests directly.
2680<section title="Via" anchor="header.via">
2681  <iref primary="true" item="Via header field" x:for-anchor=""/>
2682  <x:anchor-alias value="pseudonym"/>
2683  <x:anchor-alias value="received-by"/>
2684  <x:anchor-alias value="received-protocol"/>
2685  <x:anchor-alias value="Via"/>
2687   The "Via" header field indicates the presence of intermediate protocols and
2688   recipients between the user agent and the server (on requests) or between
2689   the origin server and the client (on responses), similar to the
2690   "Received" header field in email
2691   (<xref target="RFC5322" x:fmt="of" x:sec="3.6.7"/>).
2692   Via can be used for tracking message forwards,
2693   avoiding request loops, and identifying the protocol capabilities of
2694   senders along the request/response chain.
2696<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"/>
2697  <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> ] )
2699  <x:ref>received-protocol</x:ref> = [ <x:ref>protocol-name</x:ref> "/" ] <x:ref>protocol-version</x:ref>
2700                      ; see <xref target="header.upgrade"/>
2701  <x:ref>received-by</x:ref>       = ( <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ] ) / <x:ref>pseudonym</x:ref>
2702  <x:ref>pseudonym</x:ref>         = <x:ref>token</x:ref>
2705   Multiple Via field values represent each proxy or gateway that has
2706   forwarded the message. Each intermediary appends its own information
2707   about how the message was received, such that the end result is ordered
2708   according to the sequence of forwarding recipients.
2711   A proxy &MUST; send an appropriate Via header field, as described below, in
2712   each message that it forwards.
2713   An HTTP-to-HTTP gateway &MUST; send an appropriate Via header field in
2714   each inbound request message and &MAY; send a Via header field in
2715   forwarded response messages.
2718   For each intermediary, the received-protocol indicates the protocol and
2719   protocol version used by the upstream sender of the message. Hence, the
2720   Via field value records the advertised protocol capabilities of the
2721   request/response chain such that they remain visible to downstream
2722   recipients; this can be useful for determining what backwards-incompatible
2723   features might be safe to use in response, or within a later request, as
2724   described in <xref target="http.version"/>. For brevity, the protocol-name
2725   is omitted when the received protocol is HTTP.
2728   The received-by portion of the field value is normally the host and optional
2729   port number of a recipient server or client that subsequently forwarded the
2730   message.
2731   However, if the real host is considered to be sensitive information, a
2732   sender &MAY; replace it with a pseudonym. If a port is not provided,
2733   a recipient &MAY; interpret that as meaning it was received on the default
2734   TCP port, if any, for the received-protocol.
2737   A sender &MAY; generate comments in the Via header field to identify the
2738   software of each recipient, analogous to the <x:ref>User-Agent</x:ref> and
2739   <x:ref>Server</x:ref> header fields. However, all comments in the Via field
2740   are optional, and a recipient &MAY; remove them prior to forwarding the
2741   message.
2744   For example, a request message could be sent from an HTTP/1.0 user
2745   agent to an internal proxy code-named "fred", which uses HTTP/1.1 to
2746   forward the request to a public proxy at, which completes
2747   the request by forwarding it to the origin server at
2748   The request received by would then have the following
2749   Via header field:
2751<figure><artwork type="example">
2752  Via: 1.0 fred, 1.1
2755   An intermediary used as a portal through a network firewall
2756   &SHOULD-NOT; forward the names and ports of hosts within the firewall
2757   region unless it is explicitly enabled to do so. If not enabled, such an
2758   intermediary &SHOULD; replace each received-by host of any host behind the
2759   firewall by an appropriate pseudonym for that host.
2762   An intermediary &MAY; combine an ordered subsequence of Via header
2763   field entries into a single such entry if the entries have identical
2764   received-protocol values. For example,
2766<figure><artwork type="example">
2767  Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy
2770  could be collapsed to
2772<figure><artwork type="example">
2773  Via: 1.0 ricky, 1.1 mertz, 1.0 lucy
2776   A sender &SHOULD-NOT; combine multiple entries unless they are all
2777   under the same organizational control and the hosts have already been
2778   replaced by pseudonyms. A sender &MUST-NOT; combine entries that
2779   have different received-protocol values.
2783<section title="Transformations" anchor="message.transformations">
2784   <iref primary="true" item="transforming proxy"/>
2785   <iref primary="true" item="non-transforming proxy"/>
2787   Some intermediaries include features for transforming messages and their
2788   payloads. A proxy might, for example, convert between image formats in
2789   order to save cache space or to reduce the amount of traffic on a slow
2790   link. However, operational problems might occur when these transformations
2791   are applied to payloads intended for critical applications, such as medical
2792   imaging or scientific data analysis, particularly when integrity checks or
2793   digital signatures are used to ensure that the payload received is
2794   identical to the original.
2797   An HTTP-to-HTTP proxy is called a "<x:dfn>transforming proxy</x:dfn>"
2798   if it is designed or configured to modify messages in a semantically
2799   meaningful way (i.e., modifications, beyond those required by normal
2800   HTTP processing, that change the message in a way that would be
2801   significant to the original sender or potentially significant to
2802   downstream recipients).  For example, a transforming proxy might be
2803   acting as a shared annotation server (modifying responses to include
2804   references to a local annotation database), a malware filter, a
2805   format transcoder, or a privacy filter. Such transformations are presumed
2806   to be desired by whichever client (or client organization) selected the
2807   proxy.
2810   If a proxy receives a request-target with a host name that is not a
2811   fully qualified domain name, it &MAY; add its own domain to the host name
2812   it received when forwarding the request.  A proxy &MUST-NOT; change the
2813   host name if the request-target contains a fully qualified domain name.
2816   A proxy &MUST-NOT; modify the "absolute-path" and "query" parts of the
2817   received request-target when forwarding it to the next inbound server,
2818   except as noted above to replace an empty path with "/" or "*".
2821   A proxy &MAY; modify the message body through application
2822   or removal of a transfer coding (<xref target="transfer.codings"/>).
2825   A proxy &MUST-NOT; transform the payload (&payload;) of a message that
2826   contains a no-transform cache-control directive (&header-cache-control;).
2829   A proxy &MAY; transform the payload of a message
2830   that does not contain a no-transform cache-control directive.
2831   A proxy that transforms a payload &MUST; add a <x:ref>Warning</x:ref>
2832   header field with the warn-code of 214 ("Transformation Applied")
2833   if one is not already in the message (see &header-warning;).
2834   A proxy that transforms the payload of a <x:ref>200 (OK)</x:ref> response
2835   can further inform downstream recipients that a transformation has been
2836   applied by changing the response status code to
2837   <x:ref>203 (Non-Authoritative Information)</x:ref> (&status-203;).
2840   A proxy &SHOULD-NOT; modify header fields that provide information about
2841   the end points of the communication chain, the resource state, or the
2842   selected representation (other than the payload) unless the field's
2843   definition specifically allows such modification or the modification is
2844   deemed necessary for privacy or security.
2850<section title="Connection Management" anchor="">
2852   HTTP messaging is independent of the underlying transport or
2853   session-layer connection protocol(s).  HTTP only presumes a reliable
2854   transport with in-order delivery of requests and the corresponding
2855   in-order delivery of responses.  The mapping of HTTP request and
2856   response structures onto the data units of an underlying transport
2857   protocol is outside the scope of this specification.
2860   As described in <xref target="connecting.inbound"/>, the specific
2861   connection protocols to be used for an HTTP interaction are determined by
2862   client configuration and the <x:ref>target URI</x:ref>.
2863   For example, the "http" URI scheme
2864   (<xref target="http.uri"/>) indicates a default connection of TCP
2865   over IP, with a default TCP port of 80, but the client might be
2866   configured to use a proxy via some other connection, port, or protocol.
2869   HTTP implementations are expected to engage in connection management,
2870   which includes maintaining the state of current connections,
2871   establishing a new connection or reusing an existing connection,
2872   processing messages received on a connection, detecting connection
2873   failures, and closing each connection.
2874   Most clients maintain multiple connections in parallel, including
2875   more than one connection per server endpoint.
2876   Most servers are designed to maintain thousands of concurrent connections,
2877   while controlling request queues to enable fair use and detect
2878   denial of service attacks.
2881<section title="Connection" anchor="header.connection">
2882  <iref primary="true" item="Connection header field" x:for-anchor=""/>
2883  <iref primary="true" item="close" x:for-anchor=""/>
2884  <x:anchor-alias value="Connection"/>
2885  <x:anchor-alias value="connection-option"/>
2886  <x:anchor-alias value="close"/>
2888   The "Connection" header field allows the sender to indicate desired
2889   control options for the current connection.  In order to avoid confusing
2890   downstream recipients, a proxy or gateway &MUST; remove or replace any
2891   received connection options before forwarding the message.
2894   When a header field aside from Connection is used to supply control
2895   information for or about the current connection, the sender &MUST; list
2896   the corresponding field-name within the "Connection" header field.
2897   A proxy or gateway &MUST; parse a received Connection
2898   header field before a message is forwarded and, for each
2899   connection-option in this field, remove any header field(s) from
2900   the message with the same name as the connection-option, and then
2901   remove the Connection header field itself (or replace it with the
2902   intermediary's own connection options for the forwarded message).
2905   Hence, the Connection header field provides a declarative way of
2906   distinguishing header fields that are only intended for the
2907   immediate recipient ("hop-by-hop") from those fields that are
2908   intended for all recipients on the chain ("end-to-end"), enabling the
2909   message to be self-descriptive and allowing future connection-specific
2910   extensions to be deployed without fear that they will be blindly
2911   forwarded by older intermediaries.
2914   The Connection header field's value has the following grammar:
2916<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Connection"/><iref primary="true" item="Grammar" subitem="connection-option"/>
2917  <x:ref>Connection</x:ref>        = 1#<x:ref>connection-option</x:ref>
2918  <x:ref>connection-option</x:ref> = <x:ref>token</x:ref>
2921   Connection options are case-insensitive.
2924   A sender &MUST-NOT; send a connection option corresponding to a header
2925   field that is intended for all recipients of the payload.
2926   For example, <x:ref>Cache-Control</x:ref> is never appropriate as a
2927   connection option (&header-cache-control;).
2930   The connection options do not always correspond to a header field
2931   present in the message, since a connection-specific header field
2932   might not be needed if there are no parameters associated with a
2933   connection option. In contrast, a connection-specific header field that
2934   is received without a corresponding connection option usually indicates
2935   that the field has been improperly forwarded by an intermediary and
2936   ought to be ignored by the recipient.
2939   When defining new connection options, specification authors ought to survey
2940   existing header field names and ensure that the new connection option does
2941   not share the same name as an already deployed header field.
2942   Defining a new connection option essentially reserves that potential
2943   field-name for carrying additional information related to the
2944   connection option, since it would be unwise for senders to use
2945   that field-name for anything else.
2948   The "<x:dfn>close</x:dfn>" connection option is defined for a
2949   sender to signal that this connection will be closed after completion of
2950   the response. For example,
2952<figure><artwork type="example">
2953  Connection: close
2956   in either the request or the response header fields indicates that the
2957   sender is going to close the connection after the current request/response
2958   is complete (<xref target="persistent.tear-down"/>).
2961   A client that does not support <x:ref>persistent connections</x:ref> &MUST;
2962   send the "close" connection option in every request message.
2965   A server that does not support <x:ref>persistent connections</x:ref> &MUST;
2966   send the "close" connection option in every response message that
2967   does not have a <x:ref>1xx (Informational)</x:ref> status code.
2971<section title="Establishment" anchor="persistent.establishment">
2973   It is beyond the scope of this specification to describe how connections
2974   are established via various transport or session-layer protocols.
2975   Each connection applies to only one transport link.
2979<section title="Persistence" anchor="persistent.connections">
2980   <x:anchor-alias value="persistent connections"/>
2982   HTTP/1.1 defaults to the use of "<x:dfn>persistent connections</x:dfn>",
2983   allowing multiple requests and responses to be carried over a single
2984   connection. The "<x:ref>close</x:ref>" connection-option is used to signal
2985   that a connection will not persist after the current request/response.
2986   HTTP implementations &SHOULD; support persistent connections.
2989   A recipient determines whether a connection is persistent or not based on
2990   the most recently received message's protocol version and
2991   <x:ref>Connection</x:ref> header field (if any):
2992   <list style="symbols">
2993     <t>If the <x:ref>close</x:ref> connection option is present, the
2994        connection will not persist after the current response; else,</t>
2995     <t>If the received protocol is HTTP/1.1 (or later), the connection will
2996        persist after the current response; else,</t>
2997     <t>If the received protocol is HTTP/1.0, the "keep-alive"
2998        connection option is present, the recipient is not a proxy, and
2999        the recipient wishes to honor the HTTP/1.0 "keep-alive" mechanism,
3000        the connection will persist after the current response; otherwise,</t>
3001     <t>The connection will close after the current response.</t>
3002   </list>
3005   A client &MAY; send additional requests on a persistent connection until it
3006   sends or receives a <x:ref>close</x:ref> connection option or receives an
3007   HTTP/1.0 response without a "keep-alive" connection option.
3010   In order to remain persistent, all messages on a connection need to
3011   have a self-defined message length (i.e., one not defined by closure
3012   of the connection), as described in <xref target="message.body"/>.
3013   A server &MUST; read the entire request message body or close
3014   the connection after sending its response, since otherwise the
3015   remaining data on a persistent connection would be misinterpreted
3016   as the next request.  Likewise,
3017   a client &MUST; read the entire response message body if it intends
3018   to reuse the same connection for a subsequent request.
3021   A proxy server &MUST-NOT; maintain a persistent connection with an
3022   HTTP/1.0 client (see <xref x:sec="19.7.1" x:fmt="of" target="RFC2068"/> for
3023   information and discussion of the problems with the Keep-Alive header field
3024   implemented by many HTTP/1.0 clients).
3027   See <xref target="compatibility.with.http.1.0.persistent.connections"/>
3028   for more information on backward compatibility with HTTP/1.0 clients.
3031<section title="Retrying Requests" anchor="persistent.retrying.requests">
3033   Connections can be closed at any time, with or without intention.
3034   Implementations ought to anticipate the need to recover
3035   from asynchronous close events.
3038   When an inbound connection is closed prematurely, a client &MAY; open a new
3039   connection and automatically retransmit an aborted sequence of requests if
3040   all of those requests have idempotent methods (&idempotent-methods;).
3041   A proxy &MUST-NOT; automatically retry non-idempotent requests.
3044   A user agent &MUST-NOT; automatically retry a request with a non-idempotent
3045   method unless it has some means to know that the request semantics are
3046   actually idempotent, regardless of the method, or some means to detect that
3047   the original request was never applied. For example, a user agent that
3048   knows (through design or configuration) that a POST request to a given
3049   resource is safe can repeat that request automatically.
3050   Likewise, a user agent designed specifically to operate on a version
3051   control repository might be able to recover from partial failure conditions
3052   by checking the target resource revision(s) after a failed connection,
3053   reverting or fixing any changes that were partially applied, and then
3054   automatically retrying the requests that failed.
3057   A client &SHOULD-NOT; automatically retry a failed automatic retry.
3061<section title="Pipelining" anchor="pipelining">
3062   <x:anchor-alias value="pipeline"/>
3064   A client that supports persistent connections &MAY; "<x:dfn>pipeline</x:dfn>"
3065   its requests (i.e., send multiple requests without waiting for each
3066   response). A server &MAY; process a sequence of pipelined requests in
3067   parallel if they all have safe methods (&safe-methods;), but &MUST; send
3068   the corresponding responses in the same order that the requests were
3069   received.
3072   A client that pipelines requests &SHOULD; retry unanswered requests if the
3073   connection closes before it receives all of the corresponding responses.
3074   When retrying pipelined requests after a failed connection (a connection
3075   not explicitly closed by the server in its last complete response), a
3076   client &MUST-NOT; pipeline immediately after connection establishment,
3077   since the first remaining request in the prior pipeline might have caused
3078   an error response that can be lost again if multiple requests are sent on a
3079   prematurely closed connection (see the TCP reset problem described in
3080   <xref target="persistent.tear-down"/>).
3083   Idempotent methods (&idempotent-methods;) are significant to pipelining
3084   because they can be automatically retried after a connection failure.
3085   A user agent &SHOULD-NOT; pipeline requests after a non-idempotent method,
3086   until the final response status code for that method has been received,
3087   unless the user agent has a means to detect and recover from partial
3088   failure conditions involving the pipelined sequence.
3091   An intermediary that receives pipelined requests &MAY; pipeline those
3092   requests when forwarding them inbound, since it can rely on the outbound
3093   user agent(s) to determine what requests can be safely pipelined. If the
3094   inbound connection fails before receiving a response, the pipelining
3095   intermediary &MAY; attempt to retry a sequence of requests that have yet
3096   to receive a response if the requests all have idempotent methods;
3097   otherwise, the pipelining intermediary &SHOULD; forward any received
3098   responses and then close the corresponding outbound connection(s) so that
3099   the outbound user agent(s) can recover accordingly.
3104<section title="Concurrency" anchor="persistent.concurrency">
3106   A client ought to limit the number of simultaneous open
3107   connections that it maintains to a given server.
3110   Previous revisions of HTTP gave a specific number of connections as a
3111   ceiling, but this was found to be impractical for many applications. As a
3112   result, this specification does not mandate a particular maximum number of
3113   connections but, instead, encourages clients to be conservative when opening
3114   multiple connections.
3117   Multiple connections are typically used to avoid the "head-of-line
3118   blocking" problem, wherein a request that takes significant server-side
3119   processing and/or has a large payload blocks subsequent requests on the
3120   same connection. However, each connection consumes server resources.
3121   Furthermore, using multiple connections can cause undesirable side effects
3122   in congested networks.
3125   Note that a server might reject traffic that it deems abusive or
3126   characteristic of a denial of service attack, such as an excessive number
3127   of open connections from a single client.
3131<section title="Failures and Time-outs" anchor="persistent.failures">
3133   Servers will usually have some time-out value beyond which they will
3134   no longer maintain an inactive connection. Proxy servers might make
3135   this a higher value since it is likely that the client will be making
3136   more connections through the same proxy server. The use of persistent
3137   connections places no requirements on the length (or existence) of
3138   this time-out for either the client or the server.
3141   A client or server that wishes to time-out &SHOULD; issue a graceful close
3142   on the connection. Implementations &SHOULD; constantly monitor open
3143   connections for a received closure signal and respond to it as appropriate,
3144   since prompt closure of both sides of a connection enables allocated system
3145   resources to be reclaimed.
3148   A client, server, or proxy &MAY; close the transport connection at any
3149   time. For example, a client might have started to send a new request
3150   at the same time that the server has decided to close the "idle"
3151   connection. From the server's point of view, the connection is being
3152   closed while it was idle, but from the client's point of view, a
3153   request is in progress.
3156   A server &SHOULD; sustain persistent connections, when possible, and allow
3157   the underlying
3158   transport's flow control mechanisms to resolve temporary overloads, rather
3159   than terminate connections with the expectation that clients will retry.
3160   The latter technique can exacerbate network congestion.
3163   A client sending a message body &SHOULD; monitor
3164   the network connection for an error response while it is transmitting
3165   the request. If the client sees a response that indicates the server does
3166   not wish to receive the message body and is closing the connection, the
3167   client &SHOULD; immediately cease transmitting the body and close its side
3168   of the connection.
3172<section title="Tear-down" anchor="persistent.tear-down">
3173  <iref primary="false" item="Connection header field" x:for-anchor=""/>
3174  <iref primary="false" item="close" x:for-anchor=""/>
3176   The <x:ref>Connection</x:ref> header field
3177   (<xref target="header.connection"/>) provides a "<x:ref>close</x:ref>"
3178   connection option that a sender &SHOULD; send when it wishes to close
3179   the connection after the current request/response pair.
3182   A client that sends a <x:ref>close</x:ref> connection option &MUST-NOT;
3183   send further requests on that connection (after the one containing
3184   <x:ref>close</x:ref>) and &MUST; close the connection after reading the
3185   final response message corresponding to this request.
3188   A server that receives a <x:ref>close</x:ref> connection option &MUST;
3189   initiate a close of the connection (see below) after it sends the
3190   final response to the request that contained <x:ref>close</x:ref>.
3191   The server &SHOULD; send a <x:ref>close</x:ref> connection option
3192   in its final response on that connection. The server &MUST-NOT; process
3193   any further requests received on that connection.
3196   A server that sends a <x:ref>close</x:ref> connection option &MUST;
3197   initiate a close of the connection (see below) after it sends the
3198   response containing <x:ref>close</x:ref>. The server &MUST-NOT; process
3199   any further requests received on that connection.
3202   A client that receives a <x:ref>close</x:ref> connection option &MUST;
3203   cease sending requests on that connection and close the connection
3204   after reading the response message containing the close; if additional
3205   pipelined requests had been sent on the connection, the client &SHOULD-NOT;
3206   assume that they will be processed by the server.
3209   If a server performs an immediate close of a TCP connection, there is a
3210   significant risk that the client will not be able to read the last HTTP
3211   response.  If the server receives additional data from the client on a
3212   fully-closed connection, such as another request that was sent by the
3213   client before receiving the server's response, the server's TCP stack will
3214   send a reset packet to the client; unfortunately, the reset packet might
3215   erase the client's unacknowledged input buffers before they can be read
3216   and interpreted by the client's HTTP parser.
3219   To avoid the TCP reset problem, servers typically close a connection in
3220   stages. First, the server performs a half-close by closing only the write
3221   side of the read/write connection. The server then continues to read from
3222   the connection until it receives a corresponding close by the client, or
3223   until the server is reasonably certain that its own TCP stack has received
3224   the client's acknowledgement of the packet(s) containing the server's last
3225   response. Finally, the server fully closes the connection.
3228   It is unknown whether the reset problem is exclusive to TCP or might also
3229   be found in other transport connection protocols.
3233<section title="Upgrade" anchor="header.upgrade">
3234  <iref primary="true" item="Upgrade header field" x:for-anchor=""/>
3235  <x:anchor-alias value="Upgrade"/>
3236  <x:anchor-alias value="protocol"/>
3237  <x:anchor-alias value="protocol-name"/>
3238  <x:anchor-alias value="protocol-version"/>
3240   The "Upgrade" header field is intended to provide a simple mechanism
3241   for transitioning from HTTP/1.1 to some other protocol on the same
3242   connection.  A client &MAY; send a list of protocols in the Upgrade
3243   header field of a request to invite the server to switch to one or
3244   more of those protocols, in order of descending preference, before sending
3245   the final response. A server &MAY; ignore a received Upgrade header field
3246   if it wishes to continue using the current protocol on that connection.
3247   Upgrade cannot be used to insist on a protocol change.
3249<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Upgrade"/>
3250  <x:ref>Upgrade</x:ref>          = 1#<x:ref>protocol</x:ref>
3252  <x:ref>protocol</x:ref>         = <x:ref>protocol-name</x:ref> ["/" <x:ref>protocol-version</x:ref>]
3253  <x:ref>protocol-name</x:ref>    = <x:ref>token</x:ref>
3254  <x:ref>protocol-version</x:ref> = <x:ref>token</x:ref>
3257   A server that sends a <x:ref>101 (Switching Protocols)</x:ref> response
3258   &MUST; send an Upgrade header field to indicate the new protocol(s) to
3259   which the connection is being switched; if multiple protocol layers are
3260   being switched, the sender &MUST; list the protocols in layer-ascending
3261   order. A server &MUST-NOT; switch to a protocol that was not indicated by
3262   the client in the corresponding request's Upgrade header field.
3263   A server &MAY; choose to ignore the order of preference indicated by the
3264   client and select the new protocol(s) based on other factors, such as the
3265   nature of the request or the current load on the server.
3268   A server that sends a <x:ref>426 (Upgrade Required)</x:ref> response
3269   &MUST; send an Upgrade header field to indicate the acceptable protocols,
3270   in order of descending preference.
3273   A server &MAY; send an Upgrade header field in any other response to
3274   advertise that it implements support for upgrading to the listed protocols,
3275   in order of descending preference, when appropriate for a future request.
3278   The following is a hypothetical example sent by a client:
3279</preamble><artwork type="message/http; msgtype=&#34;request&#34;" x:indent-with="  ">
3280GET /hello.txt HTTP/1.1
3282Connection: upgrade
3283Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
3287   The capabilities and nature of the
3288   application-level communication after the protocol change is entirely
3289   dependent upon the new protocol(s) chosen. However, immediately after
3290   sending the 101 response, the server is expected to continue responding to
3291   the original request as if it had received its equivalent within the new
3292   protocol (i.e., the server still has an outstanding request to satisfy
3293   after the protocol has been changed, and is expected to do so without
3294   requiring the request to be repeated).
3297   For example, if the Upgrade header field is received in a GET request
3298   and the server decides to switch protocols, it first responds
3299   with a <x:ref>101 (Switching Protocols)</x:ref> message in HTTP/1.1 and
3300   then immediately follows that with the new protocol's equivalent of a
3301   response to a GET on the target resource.  This allows a connection to be
3302   upgraded to protocols with the same semantics as HTTP without the
3303   latency cost of an additional round-trip.  A server &MUST-NOT; switch
3304   protocols unless the received message semantics can be honored by the new
3305   protocol; an OPTIONS request can be honored by any protocol.
3308   The following is an example response to the above hypothetical request:
3309</preamble><artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
3310HTTP/1.1 101 Switching Protocols
3311Connection: upgrade
3312Upgrade: HTTP/2.0
3314[... data stream switches to HTTP/2.0 with an appropriate response
3315(as defined by new protocol) to the "GET /hello.txt" request ...]
3318   When Upgrade is sent, the sender &MUST; also send a
3319   <x:ref>Connection</x:ref> header field (<xref target="header.connection"/>)
3320   that contains an "upgrade" connection option, in order to prevent Upgrade
3321   from being accidentally forwarded by intermediaries that might not implement
3322   the listed protocols.  A server &MUST; ignore an Upgrade header field that
3323   is received in an HTTP/1.0 request.
3326   A client cannot begin using an upgraded protocol on the connection until
3327   it has completely sent the request message (i.e., the client can't change
3328   the protocol it is sending in the middle of a message).
3329   If a server receives both Upgrade and an <x:ref>Expect</x:ref> header field
3330   with the "100-continue" expectation (&header-expect;), the
3331   server &MUST; send a <x:ref>100 (Continue)</x:ref> response before sending
3332   a <x:ref>101 (Switching Protocols)</x:ref> response.
3335   The Upgrade header field only applies to switching protocols on top of the
3336   existing connection; it cannot be used to switch the underlying connection
3337   (transport) protocol, nor to switch the existing communication to a
3338   different connection. For those purposes, it is more appropriate to use a
3339   <x:ref>3xx (Redirection)</x:ref> response (&status-3xx;).
3342   This specification only defines the protocol name "HTTP" for use by
3343   the family of Hypertext Transfer Protocols, as defined by the HTTP
3344   version rules of <xref target="http.version"/> and future updates to this
3345   specification. Additional tokens ought to be registered with IANA using the
3346   registration procedure defined in <xref target="upgrade.token.registry"/>.
3351<section title="ABNF List Extension: #rule" anchor="abnf.extension">
3353   A #rule extension to the ABNF rules of <xref target="RFC5234"/> is used to
3354   improve readability in the definitions of some header field values.
3357   A construct "#" is defined, similar to "*", for defining comma-delimited
3358   lists of elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating
3359   at least &lt;n&gt; and at most &lt;m&gt; elements, each separated by a single
3360   comma (",") and optional whitespace (OWS).   
3363   In any production that uses the list construct, a sender &MUST-NOT;
3364   generate empty list elements. In other words, a sender &MUST; generate
3365   lists that satisfy the following syntax:
3366</preamble><artwork type="example">
3367  1#element =&gt; element *( OWS "," OWS element )
3370   and:
3371</preamble><artwork type="example">
3372  #element =&gt; [ 1#element ]
3375   and for n &gt;= 1 and m &gt; 1:
3376</preamble><artwork type="example">
3377  &lt;n&gt;#&lt;m&gt;element =&gt; element &lt;n-1&gt;*&lt;m-1&gt;( OWS "," OWS element )
3380   For compatibility with legacy list rules, a recipient &MUST; parse and ignore
3381   a reasonable number of empty list elements: enough to handle common mistakes
3382   by senders that merge values, but not so much that they could be used as a
3383   denial of service mechanism. In other words, a recipient &MUST; accept lists
3384   that satisfy the following syntax:
3386<figure><artwork type="example">
3387  #element =&gt; [ ( "," / element ) *( OWS "," [ OWS element ] ) ]
3389  1#element =&gt; *( "," OWS ) element *( OWS "," [ OWS element ] )
3392   Empty elements do not contribute to the count of elements present.
3393   For example, given these ABNF productions:
3395<figure><artwork type="example">
3396  example-list      = 1#example-list-elmt
3397  example-list-elmt = token ; see <xref target="field.components"/>
3400   Then the following are valid values for example-list (not including the
3401   double quotes, which are present for delimitation only):
3403<figure><artwork type="example">
3404  "foo,bar"
3405  "foo ,bar,"
3406  "foo , ,bar,charlie   "
3409   In contrast, the following values would be invalid, since at least one
3410   non-empty element is required by the example-list production:
3412<figure><artwork type="example">
3413  ""
3414  ","
3415  ",   ,"
3418   <xref target="collected.abnf"/> shows the collected ABNF for recipients
3419   after the list constructs have been expanded.
3423<section title="IANA Considerations" anchor="IANA.considerations">
3425<section title="Header Field Registration" anchor="header.field.registration">
3427   HTTP header fields are registered within the Message Header Field Registry
3428   maintained at
3429   <eref target=""/>.
3432   This document defines the following HTTP header fields, so their
3433   associated registry entries shall be updated according to the permanent
3434   registrations below (see <xref target="BCP90"/>):
3436<?BEGININC p1-messaging.iana-headers ?>
3437<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
3438<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
3439   <ttcol>Header Field Name</ttcol>
3440   <ttcol>Protocol</ttcol>
3441   <ttcol>Status</ttcol>
3442   <ttcol>Reference</ttcol>
3444   <c>Connection</c>
3445   <c>http</c>
3446   <c>standard</c>
3447   <c>
3448      <xref target="header.connection"/>
3449   </c>
3450   <c>Content-Length</c>
3451   <c>http</c>
3452   <c>standard</c>
3453   <c>
3454      <xref target="header.content-length"/>
3455   </c>
3456   <c>Host</c>
3457   <c>http</c>
3458   <c>standard</c>
3459   <c>
3460      <xref target=""/>
3461   </c>
3462   <c>TE</c>
3463   <c>http</c>
3464   <c>standard</c>
3465   <c>
3466      <xref target="header.te"/>
3467   </c>
3468   <c>Trailer</c>
3469   <c>http</c>
3470   <c>standard</c>
3471   <c>
3472      <xref target="header.trailer"/>
3473   </c>
3474   <c>Transfer-Encoding</c>
3475   <c>http</c>
3476   <c>standard</c>
3477   <c>
3478      <xref target="header.transfer-encoding"/>
3479   </c>
3480   <c>Upgrade</c>
3481   <c>http</c>
3482   <c>standard</c>
3483   <c>
3484      <xref target="header.upgrade"/>
3485   </c>
3486   <c>Via</c>
3487   <c>http</c>
3488   <c>standard</c>
3489   <c>
3490      <xref target="header.via"/>
3491   </c>
3494<?ENDINC p1-messaging.iana-headers ?>
3496   Furthermore, the header field-name "Close" shall be registered as
3497   "reserved", since using that name as an HTTP header field might
3498   conflict with the "close" connection option of the "<x:ref>Connection</x:ref>"
3499   header field (<xref target="header.connection"/>).
3501<texttable align="left" suppress-title="true">
3502   <ttcol>Header Field Name</ttcol>
3503   <ttcol>Protocol</ttcol>
3504   <ttcol>Status</ttcol>
3505   <ttcol>Reference</ttcol>
3507   <c>Close</c>
3508   <c>http</c>
3509   <c>reserved</c>
3510   <c>
3511      <xref target="header.field.registration"/>
3512   </c>
3515   The change controller is: "IETF ( - Internet Engineering Task Force".
3519<section title="URI Scheme Registration" anchor="uri.scheme.registration">
3521   IANA maintains the registry of URI Schemes <xref target="BCP115"/> at
3522   <eref target=""/>.
3525   This document defines the following URI schemes, so their
3526   associated registry entries shall be updated according to the permanent
3527   registrations below:
3529<texttable align="left" suppress-title="true">
3530   <ttcol>URI Scheme</ttcol>
3531   <ttcol>Description</ttcol>
3532   <ttcol>Reference</ttcol>
3534   <c>http</c>
3535   <c>Hypertext Transfer Protocol</c>
3536   <c><xref target="http.uri"/></c>
3538   <c>https</c>
3539   <c>Hypertext Transfer Protocol Secure</c>
3540   <c><xref target="https.uri"/></c>
3544<section title="Internet Media Type Registration" anchor="">
3546   IANA maintains the registry of Internet media types <xref target="BCP13"/> at
3547   <eref target=""/>.
3550   This document serves as the specification for the Internet media types
3551   "message/http" and "application/http". The following is to be registered with
3552   IANA.
3554<section title="Internet Media Type message/http" anchor="">
3555<iref item="Media Type" subitem="message/http" primary="true"/>
3556<iref item="message/http Media Type" primary="true"/>
3558   The message/http type can be used to enclose a single HTTP request or
3559   response message, provided that it obeys the MIME restrictions for all
3560   "message" types regarding line length and encodings.
3563  <list style="hanging" x:indent="12em">
3564    <t hangText="Type name:">
3565      message
3566    </t>
3567    <t hangText="Subtype name:">
3568      http
3569    </t>
3570    <t hangText="Required parameters:">
3571      N/A
3572    </t>
3573    <t hangText="Optional parameters:">
3574      version, msgtype
3575      <list style="hanging">
3576        <t hangText="version:">
3577          The HTTP-version number of the enclosed message
3578          (e.g., "1.1"). If not present, the version can be
3579          determined from the first line of the body.
3580        </t>
3581        <t hangText="msgtype:">
3582          The message type &mdash; "request" or "response". If not
3583          present, the type can be determined from the first
3584          line of the body.
3585        </t>
3586      </list>
3587    </t>
3588    <t hangText="Encoding considerations:">
3589      only "7bit", "8bit", or "binary" are permitted
3590    </t>
3591    <t hangText="Security considerations:">
3592      see <xref target="security.considerations"/>
3593    </t>
3594    <t hangText="Interoperability considerations:">
3595      N/A
3596    </t>
3597    <t hangText="Published specification:">
3598      This specification (see <xref target=""/>).
3599    </t>
3600    <t hangText="Applications that use this media type:">
3601      N/A
3602    </t>
3603    <t hangText="Fragment identifier considerations:">
3604      N/A
3605    </t>
3606    <t hangText="Additional information:">
3607      <list style="hanging">
3608        <t hangText="Magic number(s):">N/A</t>
3609        <t hangText="Deprecated alias names for this type:">N/A</t>
3610        <t hangText="File extension(s):">N/A</t>
3611        <t hangText="Macintosh file type code(s):">N/A</t>
3612      </list>
3613    </t>
3614    <t hangText="Person and email address to contact for further information:">
3615      See Authors' Addresses Section.
3616    </t>
3617    <t hangText="Intended usage:">
3618      COMMON
3619    </t>
3620    <t hangText="Restrictions on usage:">
3621      N/A
3622    </t>
3623    <t hangText="Author:">
3624      See Authors' Addresses Section.
3625    </t>
3626    <t hangText="Change controller:">
3627      IESG
3628    </t>
3629  </list>
3632<section title="Internet Media Type application/http" anchor="">
3633<iref item="Media Type" subitem="application/http" primary="true"/>
3634<iref item="application/http Media Type" primary="true"/>
3636   The application/http type can be used to enclose a pipeline of one or more
3637   HTTP request or response messages (not intermixed).
3640  <list style="hanging" x:indent="12em">
3641    <t hangText="Type name:">
3642      application
3643    </t>
3644    <t hangText="Subtype name:">
3645      http
3646    </t>
3647    <t hangText="Required parameters:">
3648      N/A
3649    </t>
3650    <t hangText="Optional parameters:">
3651      version, msgtype
3652      <list style="hanging">
3653        <t hangText="version:">
3654          The HTTP-version number of the enclosed messages
3655          (e.g., "1.1"). If not present, the version can be
3656          determined from the first line of the body.
3657        </t>
3658        <t hangText="msgtype:">
3659          The message type &mdash; "request" or "response". If not
3660          present, the type can be determined from the first
3661          line of the body.
3662        </t>
3663      </list>
3664    </t>
3665    <t hangText="Encoding considerations:">
3666      HTTP messages enclosed by this type
3667      are in "binary" format; use of an appropriate
3668      Content-Transfer-Encoding is required when
3669      transmitted via E-mail.
3670    </t>
3671    <t hangText="Security considerations:">
3672      see <xref target="security.considerations"/>
3673    </t>
3674    <t hangText="Interoperability considerations:">
3675      N/A
3676    </t>
3677    <t hangText="Published specification:">
3678      This specification (see <xref target=""/>).
3679    </t>
3680    <t hangText="Applications that use this media type:">
3681      N/A
3682    </t>
3683    <t hangText="Fragment identifier considerations:">
3684      N/A
3685    </t>
3686    <t hangText="Additional information:">
3687      <list style="hanging">
3688        <t hangText="Deprecated alias names for this type:">N/A</t>
3689        <t hangText="Magic number(s):">N/A</t>
3690        <t hangText="File extension(s):">N/A</t>
3691        <t hangText="Macintosh file type code(s):">N/A</t>
3692      </list>
3693    </t>
3694    <t hangText="Person and email address to contact for further information:">
3695      See Authors' Addresses Section.
3696    </t>
3697    <t hangText="Intended usage:">
3698      COMMON
3699    </t>
3700    <t hangText="Restrictions on usage:">
3701      N/A
3702    </t>
3703    <t hangText="Author:">
3704      See Authors' Addresses Section.
3705    </t>
3706    <t hangText="Change controller:">
3707      IESG
3708    </t>
3709  </list>
3714<section title="Transfer Coding Registry" anchor="transfer.coding.registry">
3716   The HTTP Transfer Coding Registry defines the name space for transfer
3717   coding names. It is maintained at <eref target=""/>.
3720<section title="Procedure" anchor="transfer.coding.registry.procedure">
3722   Registrations &MUST; include the following fields:
3723   <list style="symbols">
3724     <t>Name</t>
3725     <t>Description</t>
3726     <t>Pointer to specification text</t>
3727   </list>
3730   Names of transfer codings &MUST-NOT; overlap with names of content codings
3731   (&content-codings;) unless the encoding transformation is identical, as
3732   is the case for the compression codings defined in
3733   <xref target="compression.codings"/>.
3736   Values to be added to this name space require IETF Review (see
3737   <xref target="RFC5226" x:fmt="of" x:sec="4.1"/>), and &MUST;
3738   conform to the purpose of transfer coding defined in this specification.
3741   Use of program names for the identification of encoding formats
3742   is not desirable and is discouraged for future encodings.
3746<section title="Registration" anchor="transfer.coding.registration">
3748   The HTTP Transfer Coding Registry shall be updated with the registrations
3749   below:
3751<texttable align="left" suppress-title="true" anchor="iana.transfer.coding.registration.table">
3752   <ttcol>Name</ttcol>
3753   <ttcol>Description</ttcol>
3754   <ttcol>Reference</ttcol>
3755   <c>chunked</c>
3756   <c>Transfer in a series of chunks</c>
3757   <c>
3758      <xref target="chunked.encoding"/>
3759   </c>
3760   <c>compress</c>
3761   <c>UNIX "compress" data format <xref target="Welch"/></c>
3762   <c>
3763      <xref target="compress.coding"/>
3764   </c>
3765   <c>deflate</c>
3766   <c>"deflate" compressed data (<xref target="RFC1951"/>) inside
3767   the "zlib" data format (<xref target="RFC1950"/>)
3768   </c>
3769   <c>
3770      <xref target="deflate.coding"/>
3771   </c>
3772   <c>gzip</c>
3773   <c>GZIP file format <xref target="RFC1952"/></c>
3774   <c>
3775      <xref target="gzip.coding"/>
3776   </c>
3777   <c>x-compress</c>
3778   <c>Deprecated (alias for compress)</c>
3779   <c>
3780      <xref target="compress.coding"/>
3781   </c>
3782   <c>x-gzip</c>
3783   <c>Deprecated (alias for gzip)</c>
3784   <c>
3785      <xref target="gzip.coding"/>
3786   </c>
3791<section title="Content Coding Registration" anchor="content.coding.registration">
3793   IANA maintains the registry of HTTP Content Codings at
3794   <eref target=""/>.
3797   The HTTP Content Codings Registry shall be updated with the registrations
3798   below:
3800<texttable align="left" suppress-title="true" anchor="iana.content.coding.registration.table">
3801   <ttcol>Name</ttcol>
3802   <ttcol>Description</ttcol>
3803   <ttcol>Reference</ttcol>
3804   <c>compress</c>
3805   <c>UNIX "compress" data format <xref target="Welch"/></c>
3806   <c>
3807      <xref target="compress.coding"/>
3808   </c>
3809   <c>deflate</c>
3810   <c>"deflate" compressed data (<xref target="RFC1951"/>) inside
3811   the "zlib" data format (<xref target="RFC1950"/>)</c>
3812   <c>
3813      <xref target="deflate.coding"/>
3814   </c>
3815   <c>gzip</c>
3816   <c>GZIP file format <xref target="RFC1952"/></c>
3817   <c>
3818      <xref target="gzip.coding"/>
3819   </c>
3820   <c>x-compress</c>
3821   <c>Deprecated (alias for compress)</c>
3822   <c>
3823      <xref target="compress.coding"/>
3824   </c>
3825   <c>x-gzip</c>
3826   <c>Deprecated (alias for gzip)</c>
3827   <c>
3828      <xref target="gzip.coding"/>
3829   </c>
3833<section title="Upgrade Token Registry" anchor="upgrade.token.registry">
3835   The HTTP Upgrade Token Registry defines the name space for protocol-name
3836   tokens used to identify protocols in the <x:ref>Upgrade</x:ref> header
3837   field. The registry is maintained at <eref target=""/>.
3840<section title="Procedure" anchor="upgrade.token.registry.procedure">  
3842   Each registered protocol name is associated with contact information
3843   and an optional set of specifications that details how the connection
3844   will be processed after it has been upgraded.
3847   Registrations happen on a "First Come First Served" basis (see
3848   <xref target="RFC5226" x:sec="4.1" x:fmt="of"/>) and are subject to the
3849   following rules:
3850  <list style="numbers">
3851    <t>A protocol-name token, once registered, stays registered forever.</t>
3852    <t>The registration &MUST; name a responsible party for the
3853       registration.</t>
3854    <t>The registration &MUST; name a point of contact.</t>
3855    <t>The registration &MAY; name a set of specifications associated with
3856       that token. Such specifications need not be publicly available.</t>
3857    <t>The registration &SHOULD; name a set of expected "protocol-version"
3858       tokens associated with that token at the time of registration.</t>
3859    <t>The responsible party &MAY; change the registration at any time.
3860       The IANA will keep a record of all such changes, and make them
3861       available upon request.</t>
3862    <t>The IESG &MAY; reassign responsibility for a protocol token.
3863       This will normally only be used in the case when a
3864       responsible party cannot be contacted.</t>
3865  </list>
3868   This registration procedure for HTTP Upgrade Tokens replaces that
3869   previously defined in <xref target="RFC2817" x:fmt="of" x:sec="7.2"/>.
3873<section title="Upgrade Token Registration" anchor="upgrade.token.registration">
3875   The "HTTP" entry in the HTTP Upgrade Token Registry shall be updated with
3876   the registration below:
3878<texttable align="left" suppress-title="true">
3879   <ttcol>Value</ttcol>
3880   <ttcol>Description</ttcol>
3881   <ttcol>Expected Version Tokens</ttcol>
3882   <ttcol>Reference</ttcol>
3884   <c>HTTP</c>
3885   <c>Hypertext Transfer Protocol</c>
3886   <c>any DIGIT.DIGIT (e.g, "2.0")</c>
3887   <c><xref target="http.version"/></c>
3890   The responsible party is: "IETF ( - Internet Engineering Task Force".
3897<section title="Security Considerations" anchor="security.considerations">
3899   This section is meant to inform developers, information providers, and
3900   users of known security considerations relevant to HTTP message syntax,
3901   parsing, and routing. Security considerations about HTTP semantics and
3902   payloads are addressed in &semantics;.
3905<section title="Establishing Authority" anchor="establishing.authority">
3906  <iref item="authoritative response" primary="true"/>
3907  <iref item="phishing" primary="true"/>
3909   HTTP relies on the notion of an <x:dfn>authoritative response</x:dfn>: a
3910   response that has been determined by (or at the direction of) the authority
3911   identified within the target URI to be the most appropriate response for
3912   that request given the state of the target resource at the time of
3913   response message origination. Providing a response from a non-authoritative
3914   source, such as a shared cache, is often useful to improve performance and
3915   availability, but only to the extent that the source can be trusted or
3916   the distrusted response can be safely used.
3919   Unfortunately, establishing authority can be difficult.
3920   For example, <x:dfn>phishing</x:dfn> is an attack on the user's perception
3921   of authority, where that perception can be misled by presenting similar
3922   branding in hypertext, possibly aided by userinfo obfuscating the authority
3923   component (see <xref target="http.uri"/>).
3924   User agents can reduce the impact of phishing attacks by enabling users to
3925   easily inspect a target URI prior to making an action, by prominently
3926   distinguishing (or rejecting) userinfo when present, and by not sending
3927   stored credentials and cookies when the referring document is from an
3928   unknown or untrusted source.
3931   When a registered name is used in the authority component, the "http" URI
3932   scheme (<xref target="http.uri"/>) relies on the user's local name
3933   resolution service to determine where it can find authoritative responses.
3934   This means that any attack on a user's network host table, cached names, or
3935   name resolution libraries becomes an avenue for attack on establishing
3936   authority. Likewise, the user's choice of server for Domain Name Service
3937   (DNS), and the hierarchy of servers from which it obtains resolution
3938   results, could impact the authenticity of address mappings;
3939   DNSSEC (<xref target="RFC4033"/>) is one way to improve authenticity.
3942   Furthermore, after an IP address is obtained, establishing authority for
3943   an "http" URI is vulnerable to attacks on Internet Protocol routing.
3946   The "https" scheme (<xref target="https.uri"/>) is intended to prevent
3947   (or at least reveal) many of these potential attacks on establishing
3948   authority, provided that the negotiated TLS connection is secured and
3949   the client properly verifies that the communicating server's identity
3950   matches the target URI's authority component
3951   (see <xref target="RFC2818"/>). Correctly implementing such verification
3952   can be difficult (see <xref target="Georgiev"/>).
3956<section title="Risks of Intermediaries" anchor="risks.intermediaries">
3958   By their very nature, HTTP intermediaries are men-in-the-middle, and thus
3959   represent an opportunity for man-in-the-middle attacks. Compromise of
3960   the systems on which the intermediaries run can result in serious security
3961   and privacy problems. Intermediaries might have access to security-related
3962   information, personal information about individual users and
3963   organizations, and proprietary information belonging to users and
3964   content providers. A compromised intermediary, or an intermediary
3965   implemented or configured without regard to security and privacy
3966   considerations, might be used in the commission of a wide range of
3967   potential attacks.
3970   Intermediaries that contain a shared cache are especially vulnerable
3971   to cache poisoning attacks, as described in &cache-poisoning;.
3974   Implementers need to consider the privacy and security
3975   implications of their design and coding decisions, and of the
3976   configuration options they provide to operators (especially the
3977   default configuration).
3980   Users need to be aware that intermediaries are no more trustworthy than
3981   the people who run them; HTTP itself cannot solve this problem.
3985<section title="Attacks via Protocol Element Length" anchor="attack.protocol.element.length">
3987   Because HTTP uses mostly textual, character-delimited fields, parsers are
3988   often vulnerable to attacks based on sending very long (or very slow)
3989   streams of data, particularly where an implementation is expecting a
3990   protocol element with no predefined length.
3993   To promote interoperability, specific recommendations are made for minimum
3994   size limits on request-line (<xref target="request.line"/>)
3995   and header fields (<xref target="header.fields"/>). These are
3996   minimum recommendations, chosen to be supportable even by implementations
3997   with limited resources; it is expected that most implementations will
3998   choose substantially higher limits.
4001   A server can reject a message that
4002   has a request-target that is too long (&status-414;) or a request payload
4003   that is too large (&status-413;). Additional status codes related to
4004   capacity limits have been defined by extensions to HTTP
4005   <xref target="RFC6585"/>.
4008   Recipients ought to carefully limit the extent to which they process other
4009   protocol elements, including (but not limited to) request methods, response
4010   status phrases, header field-names, numeric values, and body chunks.
4011   Failure to limit such processing can result in buffer overflows, arithmetic
4012   overflows, or increased vulnerability to denial of service attacks.
4016<section title="Response Splitting" anchor="response.splitting">
4018   Response splitting (a.k.a, CRLF injection) is a common technique, used in
4019   various attacks on Web usage, that exploits the line-based nature of HTTP
4020   message framing and the ordered association of requests to responses on
4021   persistent connections <xref target="Klein"/>. This technique can be
4022   particularly damaging when the requests pass through a shared cache.
4025   Response splitting exploits a vulnerability in servers (usually within an
4026   application server) where an attacker can send encoded data within some
4027   parameter of the request that is later decoded and echoed within any of the
4028   response header fields of the response. If the decoded data is crafted to
4029   look like the response has ended and a subsequent response has begun, the
4030   response has been split and the content within the apparent second response
4031   is controlled by the attacker. The attacker can then make any other request
4032   on the same persistent connection and trick the recipients (including
4033   intermediaries) into believing that the second half of the split is an
4034   authoritative answer to the second request.
4037   For example, a parameter within the request-target might be read by an
4038   application server and reused within a redirect, resulting in the same
4039   parameter being echoed in the <x:ref>Location</x:ref> header field of the
4040   response. If the parameter is decoded by the application and not properly
4041   encoded when placed in the response field, the attacker can send encoded
4042   CRLF octets and other content that will make the application's single
4043   response look like two or more responses.
4046   A common defense against response splitting is to filter requests for data
4047   that looks like encoded CR and LF (e.g., "%0D" and "%0A"). However, that
4048   assumes the application server is only performing URI decoding, rather
4049   than more obscure data transformations like charset transcoding, XML entity
4050   translation, base64 decoding, sprintf reformatting, etc.  A more effective
4051   mitigation is to prevent anything other than the server's core protocol
4052   libraries from sending a CR or LF within the header section, which means
4053   restricting the output of header fields to APIs that filter for bad octets
4054   and not allowing application servers to write directly to the protocol
4055   stream.
4059<section title="Request Smuggling" anchor="request.smuggling">
4061   Request smuggling (<xref target="Linhart"/>) is a technique that exploits
4062   differences in protocol parsing among various recipients to hide additional
4063   requests (which might otherwise be blocked or disabled by policy) within an
4064   apparently harmless request.  Like response splitting, request smuggling
4065   can lead to a variety of attacks on HTTP usage.
4068   This specification has introduced new requirements on request parsing,
4069   particularly with regard to message framing in
4070   <xref target="message.body.length"/>, to reduce the effectiveness of
4071   request smuggling.
4075<section title="Message Integrity" anchor="message.integrity">
4077   HTTP does not define a specific mechanism for ensuring message integrity,
4078   instead relying on the error-detection ability of underlying transport
4079   protocols and the use of length or chunk-delimited framing to detect
4080   completeness. Additional integrity mechanisms, such as hash functions or
4081   digital signatures applied to the content, can be selectively added to
4082   messages via extensible metadata header fields. Historically, the lack of
4083   a single integrity mechanism has been justified by the informal nature of
4084   most HTTP communication.  However, the prevalence of HTTP as an information
4085   access mechanism has resulted in its increasing use within environments
4086   where verification of message integrity is crucial.
4089   User agents are encouraged to implement configurable means for detecting
4090   and reporting failures of message integrity such that those means can be
4091   enabled within environments for which integrity is necessary. For example,
4092   a browser being used to view medical history or drug interaction
4093   information needs to indicate to the user when such information is detected
4094   by the protocol to be incomplete, expired, or corrupted during transfer.
4095   Such mechanisms might be selectively enabled via user agent extensions or
4096   the presence of message integrity metadata in a response.
4097   At a minimum, user agents ought to provide some indication that allows a
4098   user to distinguish between a complete and incomplete response message
4099   (<xref target="incomplete.messages"/>) when such verification is desired.
4103<section title="Message Confidentiality" anchor="message.confidentiality">
4105   HTTP relies on underlying transport protocols to provide message
4106   confidentiality when that is desired. HTTP has been specifically designed
4107   to be independent of the transport protocol, such that it can be used
4108   over many different forms of encrypted connection, with the selection of
4109   such transports being identified by the choice of URI scheme or within
4110   user agent configuration.
4113   The "https" scheme can be used to identify resources that require a
4114   confidential connection, as described in <xref target="https.uri"/>.
4118<section title="Privacy of Server Log Information" anchor="privacy.of.server.log.information">
4120   A server is in the position to save personal data about a user's requests
4121   over time, which might identify their reading patterns or subjects of
4122   interest.  In particular, log information gathered at an intermediary
4123   often contains a history of user agent interaction, across a multitude
4124   of sites, that can be traced to individual users.
4127   HTTP log information is confidential in nature; its handling is often
4128   constrained by laws and regulations.  Log information needs to be securely
4129   stored and appropriate guidelines followed for its analysis.
4130   Anonymization of personal information within individual entries helps,
4131   but is generally not sufficient to prevent real log traces from being
4132   re-identified based on correlation with other access characteristics.
4133   As such, access traces that are keyed to a specific client are unsafe to
4134   publish even if the key is pseudonymous.
4137   To minimize the risk of theft or accidental publication, log information
4138   ought to be purged of personally identifiable information, including
4139   user identifiers, IP addresses, and user-provided query parameters,
4140   as soon as that information is no longer necessary to support operational
4141   needs for security, auditing, or fraud control.
4146<section title="Acknowledgments" anchor="acks">
4148   This edition of HTTP/1.1 builds on the many contributions that went into
4149   <xref target="RFC1945" format="none">RFC 1945</xref>,
4150   <xref target="RFC2068" format="none">RFC 2068</xref>,
4151   <xref target="RFC2145" format="none">RFC 2145</xref>, and
4152   <xref target="RFC2616" format="none">RFC 2616</xref>, including
4153   substantial contributions made by the previous authors, editors, and
4154   working group chairs: Tim Berners-Lee, Ari Luotonen, Roy T. Fielding,
4155   Henrik Frystyk Nielsen, Jim Gettys, Jeffrey C. Mogul, Larry Masinter,
4156   and Paul J. Leach. Mark Nottingham oversaw this effort as working group chair.
4159   Since 1999, the following contributors have helped improve the HTTP
4160   specification by reporting bugs, asking smart questions, drafting or
4161   reviewing text, and evaluating open issues:
4163<?BEGININC acks ?>
4164<t>Adam Barth,
4165Adam Roach,
4166Addison Phillips,
4167Adrian Chadd,
4168Adrian Cole,
4169Adrien W. de Croy,
4170Alan Ford,
4171Alan Ruttenberg,
4172Albert Lunde,
4173Alek Storm,
4174Alex Rousskov,
4175Alexandre Morgaut,
4176Alexey Melnikov,
4177Alisha Smith,
4178Amichai Rothman,
4179Amit Klein,
4180Amos Jeffries,
4181Andreas Maier,
4182Andreas Petersson,
4183Andrei Popov,
4184Anil Sharma,
4185Anne van Kesteren,
4186Anthony Bryan,
4187Asbjorn Ulsberg,
4188Ashok Kumar,
4189Balachander Krishnamurthy,
4190Barry Leiba,
4191Ben Laurie,
4192Benjamin Carlyle,
4193Benjamin Niven-Jenkins,
4194Benoit Claise,
4195Bil Corry,
4196Bill Burke,
4197Bjoern Hoehrmann,
4198Bob Scheifler,
4199Boris Zbarsky,
4200Brett Slatkin,
4201Brian Kell,
4202Brian McBarron,
4203Brian Pane,
4204Brian Raymor,
4205Brian Smith,
4206Bruce Perens,
4207Bryce Nesbitt,
4208Cameron Heavon-Jones,
4209Carl Kugler,
4210Carsten Bormann,
4211Charles Fry,
4212Chris Burdess,
4213Chris Newman,
4214Christian Huitema,
4215Cyrus Daboo,
4216Dale Robert Anderson,
4217Dan Wing,
4218Dan Winship,
4219Daniel Stenberg,
4220Darrel Miller,
4221Dave Cridland,
4222Dave Crocker,
4223Dave Kristol,
4224Dave Thaler,
4225David Booth,
4226David Singer,
4227David W. Morris,
4228Diwakar Shetty,
4229Dmitry Kurochkin,
4230Drummond Reed,
4231Duane Wessels,
4232Edward Lee,
4233Eitan Adler,
4234Eliot Lear,
4235Emile Stephan,
4236Eran Hammer-Lahav,
4237Eric D. Williams,
4238Eric J. Bowman,
4239Eric Lawrence,
4240Eric Rescorla,
4241Erik Aronesty,
4242EungJun Yi,
4243Evan Prodromou,
4244Felix Geisendoerfer,
4245Florian Weimer,
4246Frank Ellermann,
4247Fred Akalin,
4248Fred Bohle,
4249Frederic Kayser,
4250Gabor Molnar,
4251Gabriel Montenegro,
4252Geoffrey Sneddon,
4253Gervase Markham,
4254Gili Tzabari,
4255Grahame Grieve,
4256Greg Slepak,
4257Greg Wilkins,
4258Grzegorz Calkowski,
4259Harald Tveit Alvestrand,
4260Harry Halpin,
4261Helge Hess,
4262Henrik Nordstrom,
4263Henry S. Thompson,
4264Henry Story,
4265Herbert van de Sompel,
4266Herve Ruellan,
4267Howard Melman,
4268Hugo Haas,
4269Ian Fette,
4270Ian Hickson,
4271Ido Safruti,
4272Ilari Liusvaara,
4273Ilya Grigorik,
4274Ingo Struck,
4275J. Ross Nicoll,
4276James Cloos,
4277James H. Manger,
4278James Lacey,
4279James M. Snell,
4280Jamie Lokier,
4281Jan Algermissen,
4282Jari Arkko,
4283Jeff Hodges (who came up with the term 'effective Request-URI'),
4284Jeff Pinner,
4285Jeff Walden,
4286Jim Luther,
4287Jitu Padhye,
4288Joe D. Williams,
4289Joe Gregorio,
4290Joe Orton,
4291Joel Jaeggli,
4292John C. Klensin,
4293John C. Mallery,
4294John Cowan,
4295John Kemp,
4296John Panzer,
4297John Schneider,
4298John Stracke,
4299John Sullivan,
4300Jonas Sicking,
4301Jonathan A. Rees,
4302Jonathan Billington,
4303Jonathan Moore,
4304Jonathan Silvera,
4305Jordi Ros,
4306Joris Dobbelsteen,
4307Josh Cohen,
4308Julien Pierre,
4309Jungshik Shin,
4310Justin Chapweske,
4311Justin Erenkrantz,
4312Justin James,
4313Kalvinder Singh,
4314Karl Dubost,
4315Kathleen Moriarty,
4316Keith Hoffman,
4317Keith Moore,
4318Ken Murchison,
4319Koen Holtman,
4320Konstantin Voronkov,
4321Kris Zyp,
4322Leif Hedstrom,
4323Lionel Morand,
4324Lisa Dusseault,
4325Maciej Stachowiak,
4326Manu Sporny,
4327Marc Schneider,
4328Marc Slemko,
4329Mark Baker,
4330Mark Pauley,
4331Mark Watson,
4332Markus Isomaki,
4333Markus Lanthaler,
4334Martin J. Duerst,
4335Martin Musatov,
4336Martin Nilsson,
4337Martin Thomson,
4338Matt Lynch,
4339Matthew Cox,
4340Matthew Kerwin,
4341Max Clark,
4342Menachem Dodge,
4343Meral Shirazipour,
4344Michael Burrows,
4345Michael Hausenblas,
4346Michael Scharf,
4347Michael Sweet,
4348Michael Tuexen,
4349Michael Welzl,
4350Mike Amundsen,
4351Mike Belshe,
4352Mike Bishop,
4353Mike Kelly,
4354Mike Schinkel,
4355Miles Sabin,
4356Murray S. Kucherawy,
4357Mykyta Yevstifeyev,
4358Nathan Rixham,
4359Nicholas Shanks,
4360Nico Williams,
4361Nicolas Alvarez,
4362Nicolas Mailhot,
4363Noah Slater,
4364Osama Mazahir,
4365Pablo Castro,
4366Pat Hayes,
4367Patrick R. McManus,
4368Paul E. Jones,
4369Paul Hoffman,
4370Paul Marquess,
4371Pete Resnick,
4372Peter Lepeska,
4373Peter Occil,
4374Peter Saint-Andre,
4375Peter Watkins,
4376Phil Archer,
4377Phil Hunt,
4378Philippe Mougin,
4379Phillip Hallam-Baker,
4380Piotr Dobrogost,
4381Poul-Henning Kamp,
4382Preethi Natarajan,
4383Rajeev Bector,
4384Ray Polk,
4385Reto Bachmann-Gmuer,
4386Richard Barnes,
4387Richard Cyganiak,
4388Rob Trace,
4389Robby Simpson,
4390Robert Brewer,
4391Robert Collins,
4392Robert Mattson,
4393Robert O'Callahan,
4394Robert Olofsson,
4395Robert Sayre,
4396Robert Siemer,
4397Robert de Wilde,
4398Roberto Javier Godoy,
4399Roberto Peon,
4400Roland Zink,
4401Ronny Widjaja,
4402Ryan Hamilton,
4403S. Mike Dierken,
4404Salvatore Loreto,
4405Sam Johnston,
4406Sam Pullara,
4407Sam Ruby,
4408Saurabh Kulkarni,
4409Scott Lawrence (who maintained the original issues list),
4410Sean B. Palmer,
4411Sean Turner,
4412Sebastien Barnoud,
4413Shane McCarron,
4414Shigeki Ohtsu,
4415Simon Yarde,
4416Stefan Eissing,
4417Stefan Tilkov,
4418Stefanos Harhalakis,
4419Stephane Bortzmeyer,
4420Stephen Farrell,
4421Stephen Kent,
4422Stephen Ludin,
4423Stuart Williams,
4424Subbu Allamaraju,
4425Subramanian Moonesamy,
4426Susan Hares,
4427Sylvain Hellegouarch,
4428Tapan Divekar,
4429Tatsuhiro Tsujikawa,
4430Tatsuya Hayashi,
4431Ted Hardie,
4432Ted Lemon,
4433Thomas Broyer,
4434Thomas Fossati,
4435Thomas Maslen,
4436Thomas Nadeau,
4437Thomas Nordin,
4438Thomas Roessler,
4439Tim Bray,
4440Tim Morgan,
4441Tim Olsen,
4442Tom Zhou,
4443Travis Snoozy,
4444Tyler Close,
4445Vincent Murphy,
4446Wenbo Zhu,
4447Werner Baumann,
4448Wilbur Streett,
4449Wilfredo Sanchez Vega,
4450William A. Rowe Jr.,
4451William Chan,
4452Willy Tarreau,
4453Xiaoshu Wang,
4454Yaron Goland,
4455Yngve Nysaeter Pettersen,
4456Yoav Nir,
4457Yogesh Bang,
4458Yuchung Cheng,
4459Yutaka Oiwa,
4460Yves Lafon (long-time member of the editor team),
4461Zed A. Shaw, and
4462Zhong Yu.
4464<?ENDINC acks ?>
4466   See <xref target="RFC2616" x:fmt="of" x:sec="16"/> for additional
4467   acknowledgements from prior revisions.
4474<references title="Normative References">
4476<reference anchor="RFC7231">
4477  <front>
4478    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
4479    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4480      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4481      <address><email></email></address>
4482    </author>
4483    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4484      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4485      <address><email></email></address>
4486    </author>
4487    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4488  </front>
4489  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;"/>
4490  <x:source href="p2-semantics.xml" basename="p2-semantics">
4491    <x:defines>1xx (Informational)</x:defines>
4492    <x:defines>1xx</x:defines>
4493    <x:defines>100 (Continue)</x:defines>
4494    <x:defines>101 (Switching Protocols)</x:defines>
4495    <x:defines>2xx (Successful)</x:defines>
4496    <x:defines>2xx</x:defines>
4497    <x:defines>200 (OK)</x:defines>
4498    <x:defines>203 (Non-Authoritative Information)</x:defines>
4499    <x:defines>204 (No Content)</x:defines>
4500    <x:defines>3xx (Redirection)</x:defines>
4501    <x:defines>3xx</x:defines>
4502    <x:defines>301 (Moved Permanently)</x:defines>
4503    <x:defines>4xx (Client Error)</x:defines>
4504    <x:defines>4xx</x:defines>
4505    <x:defines>400 (Bad Request)</x:defines>
4506    <x:defines>411 (Length Required)</x:defines>
4507    <x:defines>414 (URI Too Long)</x:defines>
4508    <x:defines>417 (Expectation Failed)</x:defines>
4509    <x:defines>426 (Upgrade Required)</x:defines>
4510    <x:defines>501 (Not Implemented)</x:defines>
4511    <x:defines>502 (Bad Gateway)</x:defines>
4512    <x:defines>505 (HTTP Version Not Supported)</x:defines>
4513    <x:defines>Accept-Encoding</x:defines>
4514    <x:defines>Allow</x:defines>
4515    <x:defines>Content-Encoding</x:defines>
4516    <x:defines>Content-Location</x:defines>
4517    <x:defines>Content-Type</x:defines>
4518    <x:defines>Date</x:defines>
4519    <x:defines>Expect</x:defines>
4520    <x:defines>Location</x:defines>
4521    <x:defines>Server</x:defines>
4522    <x:defines>User-Agent</x:defines>
4523  </x:source>
4526<reference anchor="RFC7232">
4527  <front>
4528    <title>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>
4529    <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
4530      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4531      <address><email></email></address>
4532    </author>
4533    <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
4534      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4535      <address><email></email></address>
4536    </author>
4537    <date month="&ID-MONTH;" year="&ID-YEAR;" />
4538  </front>
4539  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;" />
4540  <x:source basename="p4-conditional" href="p4-conditional.xml">
4541    <x:defines>304 (Not Modified)</x:defines>
4542    <x:defines>ETag</x:defines>
4543    <x:defines>Last-Modified</x:defines>
4544  </x:source>
4547<reference anchor="RFC7233">
4548  <front>
4549    <title>Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>
4550    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4551      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4552      <address><email></email></address>
4553    </author>
4554    <author initials="Y." surname="Lafon" fullname="Yves Lafon" role="editor">
4555      <organization abbrev="W3C">World Wide Web Consortium</organization>
4556      <address><email></email></address>
4557    </author>
4558    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4559      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4560      <address><email></email></address>
4561    </author>
4562    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4563  </front>
4564  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;"/>
4565  <x:source href="p5-range.xml" basename="p5-range">
4566    <x:defines>Content-Range</x:defines>
4567  </x:source>
4570<reference anchor="RFC7234">
4571  <front>
4572    <title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
4573    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4574      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4575      <address><email></email></address>
4576    </author>
4577    <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
4578      <organization>Akamai</organization>
4579      <address><email></email></address>
4580    </author>
4581    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4582      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4583      <address><email></email></address>
4584    </author>
4585    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4586  </front>
4587  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p6-cache-&ID-VERSION;"/>
4588  <x:source href="p6-cache.xml" basename="p6-cache">
4589    <x:defines>Cache-Control</x:defines>
4590    <x:defines>Expires</x:defines>
4591    <x:defines>Warning</x:defines>
4592  </x:source>
4595<reference anchor="RFC7235">
4596  <front>
4597    <title>Hypertext Transfer Protocol (HTTP/1.1): Authentication</title>
4598    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
4599      <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
4600      <address><email></email></address>
4601    </author>
4602    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke" role="editor">
4603      <organization abbrev="greenbytes">greenbytes GmbH</organization>
4604      <address><email></email></address>
4605    </author>
4606    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
4607  </front>
4608  <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p7-auth-&ID-VERSION;"/>
4609  <x:source href="p7-auth.xml" basename="p7-auth">
4610    <x:defines>Proxy-Authenticate</x:defines>
4611    <x:defines>Proxy-Authorization</x:defines>
4612  </x:source>
4615<reference anchor="RFC5234">
4616  <front>
4617    <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
4618    <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
4619      <organization>Brandenburg InternetWorking</organization>
4620      <address>
4621        <email></email>
4622      </address> 
4623    </author>
4624    <author initials="P." surname="Overell" fullname="Paul Overell">
4625      <organization>THUS plc.</organization>
4626      <address>
4627        <email></email>
4628      </address>
4629    </author>
4630    <date month="January" year="2008"/>
4631  </front>
4632  <seriesInfo name="STD" value="68"/>
4633  <seriesInfo name="RFC" value="5234"/>
4636<reference anchor="RFC2119">
4637  <front>
4638    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
4639    <author initials="S." surname="Bradner" fullname="Scott Bradner">
4640      <organization>Harvard University</organization>
4641      <address><email></email></address>
4642    </author>
4643    <date month="March" year="1997"/>
4644  </front>
4645  <seriesInfo name="BCP" value="14"/>
4646  <seriesInfo name="RFC" value="2119"/>
4649<reference anchor="RFC3986">
4650 <front>
4651  <title abbrev='URI Generic Syntax'>Uniform Resource Identifier (URI): Generic Syntax</title>
4652  <author initials='T.' surname='Berners-Lee' fullname='Tim Berners-Lee'>
4653    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
4654    <address>
4655       <email></email>
4656       <uri></uri>
4657    </address>
4658  </author>
4659  <author initials='R.' surname='Fielding' fullname='Roy T. Fielding'>
4660    <organization abbrev="Day Software">Day Software</organization>
4661    <address>
4662      <email></email>
4663      <uri></uri>
4664    </address>
4665  </author>
4666  <author initials='L.' surname='Masinter' fullname='Larry Masinter'>
4667    <organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
4668    <address>
4669      <email></email>
4670      <uri></uri>
4671    </address>
4672  </author>
4673  <date month='January' year='2005'></date>
4674 </front>
4675 <seriesInfo name="STD" value="66"/>
4676 <seriesInfo name="RFC" value="3986"/>
4679<reference anchor="RFC0793">
4680  <front>
4681    <title>Transmission Control Protocol</title>
4682    <author initials='J.' surname='Postel' fullname='Jon Postel'>
4683      <organization>University of Southern California (USC)/Information Sciences Institute</organization>
4684    </author>
4685    <date year='1981' month='September' />
4686  </front>
4687  <seriesInfo name='STD' value='7' />
4688  <seriesInfo name='RFC' value='793' />
4691<reference anchor="USASCII">
4692  <front>
4693    <title>Coded Character Set -- 7-bit American Standard Code for Information Interchange</title>
4694    <author>
4695      <organization>American National Standards Institute</organization>
4696    </author>
4697    <date year="1986"/>
4698  </front>
4699  <seriesInfo name="ANSI" value="X3.4"/>
4702<reference anchor="RFC1950">
4703  <front>
4704    <title>ZLIB Compressed Data Format Specification version 3.3</title>
4705    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4706      <organization>Aladdin Enterprises</organization>
4707      <address><email></email></address>
4708    </author>
4709    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly"/>
4710    <date month="May" year="1996"/>
4711  </front>
4712  <seriesInfo name="RFC" value="1950"/>
4713  <!--<annotation>
4714    RFC 1950 is an Informational RFC, thus it might be less stable than
4715    this specification. On the other hand, this downward reference was
4716    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4717    therefore it is unlikely to cause problems in practice. See also
4718    <xref target="BCP97"/>.
4719  </annotation>-->
4722<reference anchor="RFC1951">
4723  <front>
4724    <title>DEFLATE Compressed Data Format Specification version 1.3</title>
4725    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4726      <organization>Aladdin Enterprises</organization>
4727      <address><email></email></address>
4728    </author>
4729    <date month="May" year="1996"/>
4730  </front>
4731  <seriesInfo name="RFC" value="1951"/>
4732  <!--<annotation>
4733    RFC 1951 is an Informational RFC, thus it might be less stable than
4734    this specification. On the other hand, this downward reference was
4735    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4736    therefore it is unlikely to cause problems in practice. See also
4737    <xref target="BCP97"/>.
4738  </annotation>-->
4741<reference anchor="RFC1952">
4742  <front>
4743    <title>GZIP file format specification version 4.3</title>
4744    <author initials="P." surname="Deutsch" fullname="L. Peter Deutsch">
4745      <organization>Aladdin Enterprises</organization>
4746      <address><email></email></address>
4747    </author>
4748    <author initials="J-L." surname="Gailly" fullname="Jean-Loup Gailly">
4749      <address><email></email></address>
4750    </author>
4751    <author initials="M." surname="Adler" fullname="Mark Adler">
4752      <address><email></email></address>
4753    </author>
4754    <author initials="L.P." surname="Deutsch" fullname="L. Peter Deutsch">
4755      <address><email></email></address>
4756    </author>
4757    <author initials="G." surname="Randers-Pehrson" fullname="Glenn Randers-Pehrson">
4758      <address><email></email></address>
4759    </author>
4760    <date month="May" year="1996"/>
4761  </front>
4762  <seriesInfo name="RFC" value="1952"/>
4763  <!--<annotation>
4764    RFC 1952 is an Informational RFC, thus it might be less stable than
4765    this specification. On the other hand, this downward reference was
4766    present since the publication of <xref target="RFC2068" x:fmt="none">RFC 2068</xref> in 1997,
4767    therefore it is unlikely to cause problems in practice. See also
4768    <xref target="BCP97"/>.
4769  </annotation>-->
4772<reference anchor="Welch">
4773  <front>
4774    <title>A Technique for High Performance Data Compression</title>
4775    <author initials="T.A." surname="Welch" fullname="Terry A. Welch"/>
4776    <date month="June" year="1984"/>
4777  </front>
4778  <seriesInfo name="IEEE Computer" value="17(6)"/>
4783<references title="Informative References">
4785<reference anchor="ISO-8859-1">
4786  <front>
4787    <title>
4788     Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1
4789    </title>
4790    <author>
4791      <organization>International Organization for Standardization</organization>
4792    </author>
4793    <date year="1998"/>
4794  </front>
4795  <seriesInfo name="ISO/IEC" value="8859-1:1998"/>
4798<reference anchor='RFC1919'>
4799  <front>
4800    <title>Classical versus Transparent IP Proxies</title>
4801    <author initials='M.' surname='Chatel' fullname='Marc Chatel'>
4802      <address><email></email></address>
4803    </author>
4804    <date year='1996' month='March' />
4805  </front>
4806  <seriesInfo name='RFC' value='1919' />
4809<reference anchor="RFC1945">
4810  <front>
4811    <title abbrev="HTTP/1.0">Hypertext Transfer Protocol -- HTTP/1.0</title>
4812    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4813      <organization>MIT, Laboratory for Computer Science</organization>
4814      <address><email></email></address>
4815    </author>
4816    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4817      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4818      <address><email></email></address>
4819    </author>
4820    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4821      <organization>W3 Consortium, MIT Laboratory for Computer Science</organization>
4822      <address><email></email></address>
4823    </author>
4824    <date month="May" year="1996"/>
4825  </front>
4826  <seriesInfo name="RFC" value="1945"/>
4829<reference anchor="RFC2045">
4830  <front>
4831    <title abbrev="Internet Message Bodies">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</title>
4832    <author initials="N." surname="Freed" fullname="Ned Freed">
4833      <organization>Innosoft International, Inc.</organization>
4834      <address><email></email></address>
4835    </author>
4836    <author initials="N.S." surname="Borenstein" fullname="Nathaniel S. Borenstein">
4837      <organization>First Virtual Holdings</organization>
4838      <address><email></email></address>
4839    </author>
4840    <date month="November" year="1996"/>
4841  </front>
4842  <seriesInfo name="RFC" value="2045"/>
4845<reference anchor="RFC2047">
4846  <front>
4847    <title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title>
4848    <author initials="K." surname="Moore" fullname="Keith Moore">
4849      <organization>University of Tennessee</organization>
4850      <address><email></email></address>
4851    </author>
4852    <date month="November" year="1996"/>
4853  </front>
4854  <seriesInfo name="RFC" value="2047"/>
4857<reference anchor="RFC2068">
4858  <front>
4859    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4860    <author initials="R." surname="Fielding" fullname="Roy T. Fielding">
4861      <organization>University of California, Irvine, Department of Information and Computer Science</organization>
4862      <address><email></email></address>
4863    </author>
4864    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4865      <organization>MIT Laboratory for Computer Science</organization>
4866      <address><email></email></address>
4867    </author>
4868    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
4869      <organization>Digital Equipment Corporation, Western Research Laboratory</organization>
4870      <address><email></email></address>
4871    </author>
4872    <author initials="H." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4873      <organization>MIT Laboratory for Computer Science</organization>
4874      <address><email></email></address>
4875    </author>
4876    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
4877      <organization>MIT Laboratory for Computer Science</organization>
4878      <address><email></email></address>
4879    </author>
4880    <date month="January" year="1997"/>
4881  </front>
4882  <seriesInfo name="RFC" value="2068"/>
4885<reference anchor="RFC2145">
4886  <front>
4887    <title abbrev="HTTP Version Numbers">Use and Interpretation of HTTP Version Numbers</title>
4888    <author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul">
4889      <organization>Western Research Laboratory</organization>
4890      <address><email></email></address>
4891    </author>
4892    <author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
4893      <organization>Department of Information and Computer Science</organization>
4894      <address><email></email></address>
4895    </author>
4896    <author initials="J." surname="Gettys" fullname="Jim Gettys">
4897      <organization>MIT Laboratory for Computer Science</organization>
4898      <address><email></email></address>
4899    </author>
4900    <author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
4901      <organization>W3 Consortium</organization>
4902      <address><email></email></address>
4903    </author>
4904    <date month="May" year="1997"/>
4905  </front>
4906  <seriesInfo name="RFC" value="2145"/>
4909<reference anchor="RFC2616">
4910  <front>
4911    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
4912    <author initials="R." surname="Fielding" fullname="R. Fielding">
4913      <organization>University of California, Irvine</organization>
4914      <address><email></email></address>
4915    </author>
4916    <author initials="J." surname="Gettys" fullname="J. Gettys">
4917      <organization>W3C</organization>
4918      <address><email></email></address>
4919    </author>
4920    <author initials="J." surname="Mogul" fullname="J. Mogul">
4921      <organization>Compaq Computer Corporation</organization>
4922      <address><email></email></address>
4923    </author>
4924    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
4925      <organization>MIT Laboratory for Computer Science</organization>
4926      <address><email></email></address>
4927    </author>
4928    <author initials="L." surname="Masinter" fullname="L. Masinter">
4929      <organization>Xerox Corporation</organization>
4930      <address><email></email></address>
4931    </author>
4932    <author initials="P." surname="Leach" fullname="P. Leach">
4933      <organization>Microsoft Corporation</organization>
4934      <address><email></email></address>
4935    </author>
4936    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
4937      <organization>W3C</organization>
4938      <address><email></email></address>
4939    </author>
4940    <date month="June" year="1999"/>
4941  </front>
4942  <seriesInfo name="RFC" value="2616"/>
4945<reference anchor='RFC2817'>
4946  <front>
4947    <title>Upgrading to TLS Within HTTP/1.1</title>
4948    <author initials='R.' surname='Khare' fullname='R. Khare'>
4949      <organization>4K Associates / UC Irvine</organization>
4950      <address><email></email></address>
4951    </author>
4952    <author initials='S.' surname='Lawrence' fullname='S. Lawrence'>
4953      <organization>Agranat Systems, Inc.</organization>
4954      <address><email></email></address>
4955    </author>
4956    <date year='2000' month='May' />
4957  </front>
4958  <seriesInfo name='RFC' value='2817' />
4961<reference anchor='RFC2818'>
4962  <front>
4963    <title>HTTP Over TLS</title>
4964    <author initials='E.' surname='Rescorla' fullname='Eric Rescorla'>
4965      <organization>RTFM, Inc.</organization>
4966      <address><email></email></address>
4967    </author>
4968    <date year='2000' month='May' />
4969  </front>
4970  <seriesInfo name='RFC' value='2818' />
4973<reference anchor='RFC3040'>
4974  <front>
4975    <title>Internet Web Replication and Caching Taxonomy</title>
4976    <author initials='I.' surname='Cooper' fullname='I. Cooper'>
4977      <organization>Equinix, Inc.</organization>
4978    </author>
4979    <author initials='I.' surname='Melve' fullname='I. Melve'>
4980      <organization>UNINETT</organization>
4981    </author>
4982    <author initials='G.' surname='Tomlinson' fullname='G. Tomlinson'>
4983      <organization>CacheFlow Inc.</organization>
4984    </author>
4985    <date year='2001' month='January' />
4986  </front>
4987  <seriesInfo name='RFC' value='3040' />
4990<reference anchor='BCP90'>
4991  <front>
4992    <title>Registration Procedures for Message Header Fields</title>
4993    <author initials='G.' surname='Klyne' fullname='G. Klyne'>
4994      <organization>Nine by Nine</organization>
4995      <address><email></email></address>
4996    </author>
4997    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
4998      <organization>BEA Systems</organization>
4999      <address><email></email></address>
5000    </author>
5001    <author initials='J.' surname='Mogul' fullname='J. Mogul'>
5002      <organization>HP Labs</organization>
5003      <address><email></email></address>
5004    </author>
5005    <date year='2004' month='September' />
5006  </front>
5007  <seriesInfo name='BCP' value='90' />
5008  <seriesInfo name='RFC' value='3864' />
5011<reference anchor='RFC4033'>
5012  <front>
5013    <title>DNS Security Introduction and Requirements</title>
5014    <author initials='R.' surname='Arends' fullname='R. Arends'/>
5015    <author initials='R.' surname='Austein' fullname='R. Austein'/>
5016    <author initials='M.' surname='Larson' fullname='M. Larson'/>
5017    <author initials='D.' surname='Massey' fullname='D. Massey'/>
5018    <author initials='S.' surname='Rose' fullname='S. Rose'/>
5019    <date year='2005' month='March' />
5020  </front>
5021  <seriesInfo name='RFC' value='4033' />
5024<reference anchor="BCP13">
5025  <front>
5026    <title>Media Type Specifications and Registration Procedures</title>
5027    <author initials="N." surname="Freed" fullname="Ned Freed">
5028      <organization>Oracle</organization>
5029      <address>
5030        <email></email>
5031      </address>
5032    </author>
5033    <author initials="J." surname="Klensin" fullname="John C. Klensin">
5034      <address>
5035        <email></email>
5036      </address>
5037    </author>
5038    <author initials="T." surname="Hansen" fullname="Tony Hansen">
5039      <organization>AT&amp;T Laboratories</organization>
5040      <address>
5041        <email></email>
5042      </address>
5043    </author>
5044    <date year="2013" month="January"/>
5045  </front>
5046  <seriesInfo name="BCP" value="13"/>
5047  <seriesInfo name="RFC" value="6838"/>
5050<reference anchor='BCP115'>
5051  <front>
5052    <title>Guidelines and Registration Procedures for New URI Schemes</title>
5053    <author initials='T.' surname='Hansen' fullname='T. Hansen'>
5054      <organization>AT&amp;T Laboratories</organization>
5055      <address>
5056        <email></email>
5057      </address>
5058    </author>
5059    <author initials='T.' surname='Hardie' fullname='T. Hardie'>
5060      <organization>Qualcomm, Inc.</organization>
5061      <address>
5062        <email></email>
5063      </address>
5064    </author>
5065    <author initials='L.' surname='Masinter' fullname='L. Masinter'>
5066      <organization>Adobe Systems</organization>
5067      <address>
5068        <email></email>
5069      </address>
5070    </author>
5071    <date year='2006' month='February' />
5072  </front>
5073  <seriesInfo name='BCP' value='115' />
5074  <seriesInfo name='RFC' value='4395' />
5077<reference anchor='RFC4559'>
5078  <front>
5079    <title>SPNEGO-based Kerberos and NTLM HTTP Authentication in Microsoft Windows</title>
5080    <author initials='K.' surname='Jaganathan' fullname='K. Jaganathan'/>
5081    <author initials='L.' surname='Zhu' fullname='L. Zhu'/>
5082    <author initials='J.' surname='Brezak' fullname='J. Brezak'/>
5083    <date year='2006' month='June' />
5084  </front>
5085  <seriesInfo name='RFC' value='4559' />
5088<reference anchor='RFC5226'>
5089  <front>
5090    <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
5091    <author initials='T.' surname='Narten' fullname='T. Narten'>
5092      <organization>IBM</organization>
5093      <address><email></email></address>
5094    </author>
5095    <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'>
5096      <organization>Google</organization>
5097      <address><email></email></address>
5098    </author>
5099    <date year='2008' month='May' />
5100  </front>
5101  <seriesInfo name='BCP' value='26' />
5102  <seriesInfo name='RFC' value='5226' />
5105<reference anchor='RFC5246'>
5106   <front>
5107      <title>The Transport Layer Security (TLS) Protocol Version 1.2</title>
5108      <author initials='T.' surname='Dierks' fullname='T. Dierks'/>
5109      <author initials='E.' surname='Rescorla' fullname='E. Rescorla'>
5110         <organization>RTFM, Inc.</organization>
5111      </author>
5112      <date year='2008' month='August' />
5113   </front>
5114   <seriesInfo name='RFC' value='5246' />
5117<reference anchor="RFC5322">
5118  <front>
5119    <title>Internet Message Format</title>
5120    <author initials="P." surname="Resnick" fullname="P. Resnick">
5121      <organization>Qualcomm Incorporated</organization>
5122    </author>
5123    <date year="2008" month="October"/>
5124  </front>
5125  <seriesInfo name="RFC" value="5322"/>
5128<reference anchor="RFC6265">
5129  <front>
5130    <title>HTTP State Management Mechanism</title>
5131    <author initials="A." surname="Barth" fullname="Adam Barth">
5132      <organization abbrev="U.C. Berkeley">
5133        University of California, Berkeley
5134      </organization>
5135      <address><email></email></address>
5136    </author>
5137    <date year="2011" month="April" />
5138  </front>
5139  <seriesInfo name="RFC" value="6265"/>
5142<reference anchor='RFC6585'>
5143  <front>
5144    <title>Additional HTTP Status Codes</title>
5145    <author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
5146      <organization>Rackspace</organization>
5147    </author>
5148    <author initials='R.' surname='Fielding' fullname='R. Fielding'>
5149      <organization>Adobe</organization>
5150    </author>
5151    <date year='2012' month='April' />
5152   </front>
5153   <seriesInfo name='RFC' value='6585' />
5156<!--<reference anchor='BCP97'>
5157  <front>
5158    <title>Handling Normative References to Standards-Track Documents</title>
5159    <author initials='J.' surname='Klensin' fullname='J. Klensin'>
5160      <address>
5161        <email></email>
5162      </address>
5163    </author>
5164    <author initials='S.' surname='Hartman' fullname='S. Hartman'>
5165      <organization>MIT</organization>
5166      <address>
5167        <email></email>
5168      </address>
5169    </author>
5170    <date year='2007' month='June' />
5171  </front>
5172  <seriesInfo name='BCP' value='97' />
5173  <seriesInfo name='RFC' value='4897' />
5176<reference anchor="Kri2001" target="">
5177  <front>
5178    <title>HTTP Cookies: Standards, Privacy, and Politics</title>
5179    <author initials="D." surname="Kristol" fullname="David M. Kristol"/>
5180    <date year="2001" month="November"/>
5181  </front>
5182  <seriesInfo name="ACM Transactions on Internet Technology" value="1(2)"/>
5185<reference anchor="Klein" target="">
5186  <front>
5187    <title>Divide and Conquer - HTTP Response Splitting, Web Cache Poisoning Attacks, and Related Topics</title>
5188    <author initials="A." surname="Klein" fullname="Amit Klein">
5189      <organization>Sanctum, Inc.</organization>
5190    </author>
5191    <date year="2004" month="March"/>
5192  </front>
5195<reference anchor="Georgiev" target="">
5196  <front>
5197    <title>The Most Dangerous Code in the World: Validating SSL Certificates in Non-browser Software</title>
5198    <author initials="M." surname="Georgiev" fullname="Martin Georgiev"/>
5199    <author initials="S." surname="Iyengar" fullname="Subodh Iyengar"/>
5200    <author initials="S." surname="Jana" fullname="Suman Jana"/>
5201    <author initials="R." surname="Anubhai" fullname="Rishita Anubhai"/>
5202    <author initials="D." surname="Boneh" fullname="Dan Boneh"/>
5203    <author initials="V." surname="Shmatikov" fullname="Vitaly Shmatikov"/>
5204    <date year="2012" month="October"/>
5205  </front>
5206  <x:prose>In Proceedings of the 2012 ACM Conference on Computer and Communications Security (CCS '12), pp. 38-49</x:prose>
5209<reference anchor="Linhart" target="">
5210  <front>
5211    <title>HTTP Request Smuggling</title>
5212    <author initials="C." surname="Linhart" fullname="Chaim Linhart"/>
5213    <author initials="A." surname="Klein" fullname="Amit Klein"/>
5214    <author initials="R." surname="Heled" fullname="Ronen Heled"/>
5215    <author initials="S." surname="Orrin" fullname="Steve Orrin"/>
5216    <date year="2005" month="June"/>
5217  </front>
5223<section title="HTTP Version History" anchor="compatibility">
5225   HTTP has been in use since 1990. The first version, later referred to as
5226   HTTP/0.9, was a simple protocol for hypertext data transfer across the
5227   Internet, using only a single request method (GET) and no metadata.
5228   HTTP/1.0, as defined by <xref target="RFC1945"/>, added a range of request
5229   methods and MIME-like messaging, allowing for metadata to be transferred
5230   and modifiers placed on the request/response semantics. However,
5231   HTTP/1.0 did not sufficiently take into consideration the effects of
5232   hierarchical proxies, caching, the need for persistent connections, or
5233   name-based virtual hosts. The proliferation of incompletely-implemented
5234   applications calling themselves "HTTP/1.0" further necessitated a
5235   protocol version change in order for two communicating applications
5236   to determine each other's true capabilities.
5239   HTTP/1.1 remains compatible with HTTP/1.0 by including more stringent
5240   requirements that enable reliable implementations, adding only
5241   those features that can either be safely ignored by an HTTP/1.0
5242   recipient or only sent when communicating with a party advertising
5243   conformance with HTTP/1.1.
5246   HTTP/1.1 has been designed to make supporting previous versions easy.
5247   A general-purpose HTTP/1.1 server ought to be able to understand any valid
5248   request in the format of HTTP/1.0, responding appropriately with an
5249   HTTP/1.1 message that only uses features understood (or safely ignored) by
5250   HTTP/1.0 clients. Likewise, an HTTP/1.1 client can be expected to
5251   understand any valid HTTP/1.0 response.
5254   Since HTTP/0.9 did not support header fields in a request, there is no
5255   mechanism for it to support name-based virtual hosts (selection of resource
5256   by inspection of the <x:ref>Host</x:ref> header field).
5257   Any server that implements name-based virtual hosts ought to disable
5258   support for HTTP/0.9. Most requests that appear to be HTTP/0.9 are, in
5259   fact, badly constructed HTTP/1.x requests caused by a client failing to
5260   properly encode the request-target.
5263<section title="Changes from HTTP/1.0" anchor="changes.from.1.0">
5265   This section summarizes major differences between versions HTTP/1.0
5266   and HTTP/1.1.
5269<section title="Multi-homed Web Servers" anchor="">
5271   The requirements that clients and servers support the <x:ref>Host</x:ref>
5272   header field (<xref target=""/>), report an error if it is
5273   missing from an HTTP/1.1 request, and accept absolute URIs (<xref target="request-target"/>)
5274   are among the most important changes defined by HTTP/1.1.
5277   Older HTTP/1.0 clients assumed a one-to-one relationship of IP
5278   addresses and servers; there was no other established mechanism for
5279   distinguishing the intended server of a request than the IP address
5280   to which that request was directed. The <x:ref>Host</x:ref> header field was
5281   introduced during the development of HTTP/1.1 and, though it was
5282   quickly implemented by most HTTP/1.0 browsers, additional requirements
5283   were placed on all HTTP/1.1 requests in order to ensure complete
5284   adoption.  At the time of this writing, most HTTP-based services
5285   are dependent upon the Host header field for targeting requests.
5289<section title="Keep-Alive Connections" anchor="compatibility.with.http.1.0.persistent.connections">
5291   In HTTP/1.0, each connection is established by the client prior to the
5292   request and closed by the server after sending the response. However, some
5293   implementations implement the explicitly negotiated ("Keep-Alive") version
5294   of persistent connections described in <xref x:sec="19.7.1" x:fmt="of"
5295   target="RFC2068"/>.
5298   Some clients and servers might wish to be compatible with these previous
5299   approaches to persistent connections, by explicitly negotiating for them
5300   with a "Connection: keep-alive" request header field. However, some
5301   experimental implementations of HTTP/1.0 persistent connections are faulty;
5302   for example, if an HTTP/1.0 proxy server doesn't understand
5303   <x:ref>Connection</x:ref>, it will erroneously forward that header field
5304   to the next inbound server, which would result in a hung connection.
5307   One attempted solution was the introduction of a Proxy-Connection header
5308   field, targeted specifically at proxies. In practice, this was also
5309   unworkable, because proxies are often deployed in multiple layers, bringing
5310   about the same problem discussed above.
5313   As a result, clients are encouraged not to send the Proxy-Connection header
5314   field in any requests.
5317   Clients are also encouraged to consider the use of Connection: keep-alive
5318   in requests carefully; while they can enable persistent connections with
5319   HTTP/1.0 servers, clients using them will need to monitor the
5320   connection for "hung" requests (which indicate that the client ought stop
5321   sending the header field), and this mechanism ought not be used by clients
5322   at all when a proxy is being used.
5326<section title="Introduction of Transfer-Encoding" anchor="introduction.of.transfer-encoding">
5328   HTTP/1.1 introduces the <x:ref>Transfer-Encoding</x:ref> header field
5329   (<xref target="header.transfer-encoding"/>).
5330   Transfer codings need to be decoded prior to forwarding an HTTP message
5331   over a MIME-compliant protocol.
5337<section title="Changes from RFC 2616" anchor="changes.from.rfc.2616">
5339  HTTP's approach to error handling has been explained.
5340  (<xref target="conformance" />)
5343  The HTTP-version ABNF production has been clarified to be case-sensitive.
5344  Additionally, version numbers has been restricted to single digits, due
5345  to the fact that implementations are known to handle multi-digit version
5346  numbers incorrectly.
5347  (<xref target="http.version"/>)
5350  Userinfo (i.e., username and password) are now disallowed in HTTP and
5351  HTTPS URIs, because of security issues related to their transmission on the
5352  wire.
5353  (<xref target="http.uri" />)
5356  The HTTPS URI scheme is now defined by this specification; previously,
5357  it was done in  <xref target="RFC2818" x:fmt="of" x:sec="2.4"/>.
5358  Furthermore, it implies end-to-end security.
5359  (<xref target="https.uri"/>)
5362  HTTP messages can be (and often are) buffered by implementations; despite
5363  it sometimes being available as a stream, HTTP is fundamentally a
5364  message-oriented protocol.
5365  Minimum supported sizes for various protocol elements have been
5366  suggested, to improve interoperability.
5367  (<xref target="http.message" />)
5370  Invalid whitespace around field-names is now required to be rejected,
5371  because accepting it represents a security vulnerability.
5372  The ABNF productions defining header fields now only list the field value.
5373  (<xref target="header.fields"/>)
5376  Rules about implicit linear whitespace between certain grammar productions
5377  have been removed; now whitespace is only allowed where specifically
5378  defined in the ABNF.
5379  (<xref target="whitespace"/>)
5382  Header fields that span multiple lines ("line folding") are deprecated.
5383  (<xref target="field.parsing" />)
5386  The NUL octet is no longer allowed in comment and quoted-string text, and
5387  handling of backslash-escaping in them has been clarified.
5388  The quoted-pair rule no longer allows escaping control characters other than
5389  HTAB.
5390  Non-ASCII content in header fields and the reason phrase has been obsoleted
5391  and made opaque (the TEXT rule was removed).
5392  (<xref target="field.components"/>)
5395  Bogus "<x:ref>Content-Length</x:ref>" header fields are now required to be
5396  handled as errors by recipients.
5397  (<xref target="header.content-length"/>)
5400  The algorithm for determining the message body length has been clarified
5401  to indicate all of the special cases (e.g., driven by methods or status
5402  codes) that affect it, and that new protocol elements cannot define such
5403  special cases.
5404  CONNECT is a new, special case in determining message body length.
5405  "multipart/byteranges" is no longer a way of determining message body length
5406  detection.
5407  (<xref target="message.body.length"/>)
5410  The "identity" transfer coding token has been removed.
5411  (Sections <xref format="counter" target="message.body"/> and
5412  <xref format="counter" target="transfer.codings"/>)
5415  Chunk length does not include the count of the octets in the
5416  chunk header and trailer.
5417  Line folding in chunk extensions is  disallowed.
5418  (<xref target="chunked.encoding"/>)
5421  The meaning of the "deflate" content coding has been clarified.
5422  (<xref target="deflate.coding" />)
5425  The segment + query components of RFC 3986 have been used to define the
5426  request-target, instead of abs_path from RFC 1808.
5427  The asterisk-form of the request-target is only allowed with the OPTIONS
5428  method.
5429  (<xref target="request-target"/>)
5432  The term "Effective Request URI" has been introduced.
5433  (<xref target="effective.request.uri" />)
5436  Gateways do not need to generate <x:ref>Via</x:ref> header fields anymore.
5437  (<xref target="header.via"/>)
5440  Exactly when "close" connection options have to be sent has been clarified.
5441  Also, "hop-by-hop" header fields are required to appear in the Connection header
5442  field; just because they're defined as hop-by-hop in this specification
5443  doesn't exempt them.
5444  (<xref target="header.connection"/>)
5447  The limit of two connections per server has been removed.
5448  An idempotent sequence of requests is no longer required to be retried.
5449  The requirement to retry requests under certain circumstances when the
5450  server prematurely closes the connection has been removed.
5451  Also, some extraneous requirements about when servers are allowed to close
5452  connections prematurely have been removed.
5453  (<xref target="persistent.connections"/>)
5456  The semantics of the <x:ref>Upgrade</x:ref> header field is now defined in
5457  responses other than 101 (this was incorporated from <xref
5458  target="RFC2817"/>). Furthermore, the ordering in the field value is now
5459  significant.
5460  (<xref target="header.upgrade"/>)
5463  Empty list elements in list productions (e.g., a list header field containing
5464  ", ,") have been deprecated.
5465  (<xref target="abnf.extension"/>)
5468  Registration of Transfer Codings now requires IETF Review
5469  (<xref target="transfer.coding.registry"/>)
5472  This specification now defines the Upgrade Token Registry, previously
5473  defined in <xref target="RFC2817" x:fmt="of" x:sec="7.2"/>.
5474  (<xref target="upgrade.token.registry"/>)
5477  The expectation to support HTTP/0.9 requests has been removed.
5478  (<xref target="compatibility"/>)
5481  Issues with the Keep-Alive and Proxy-Connection header fields in requests
5482  are pointed out, with use of the latter being discouraged altogether.
5483  (<xref target="compatibility.with.http.1.0.persistent.connections" />)
5488<?BEGININC p1-messaging.abnf-appendix ?>
5489<section xmlns:x="" title="Collected ABNF" anchor="collected.abnf">
5491<artwork type="abnf" name="p1-messaging.parsed-abnf">
5492<x:ref>BWS</x:ref> = OWS
5494<x:ref>Connection</x:ref> = *( "," OWS ) connection-option *( OWS "," [ OWS
5495 connection-option ] )
5496<x:ref>Content-Length</x:ref> = 1*DIGIT
5498<x:ref>HTTP-message</x:ref> = start-line *( header-field CRLF ) CRLF [ message-body
5499 ]
5500<x:ref>HTTP-name</x:ref> = %x48.54.54.50 ; HTTP
5501<x:ref>HTTP-version</x:ref> = HTTP-name "/" DIGIT "." DIGIT
5502<x:ref>Host</x:ref> = uri-host [ ":" port ]
5504<x:ref>OWS</x:ref> = *( SP / HTAB )
5506<x:ref>RWS</x:ref> = 1*( SP / HTAB )
5508<x:ref>TE</x:ref> = [ ( "," / t-codings ) *( OWS "," [ OWS t-codings ] ) ]
5509<x:ref>Trailer</x:ref> = *( "," OWS ) field-name *( OWS "," [ OWS field-name ] )
5510<x:ref>Transfer-Encoding</x:ref> = *( "," OWS ) transfer-coding *( OWS "," [ OWS
5511 transfer-coding ] )
5513<x:ref>URI-reference</x:ref> = &lt;URI-reference, defined in [RFC3986], Section 4.1&gt;
5514<x:ref>Upgrade</x:ref> = *( "," OWS ) protocol *( OWS "," [ OWS protocol ] )
5516<x:ref>Via</x:ref> = *( "," OWS ) ( received-protocol RWS received-by [ RWS comment
5517 ] ) *( OWS "," [ OWS ( received-protocol RWS received-by [ RWS
5518 comment ] ) ] )
5520<x:ref>absolute-URI</x:ref> = &lt;absolute-URI, defined in [RFC3986], Section 4.3&gt;
5521<x:ref>absolute-form</x:ref> = absolute-URI
5522<x:ref>absolute-path</x:ref> = 1*( "/" segment )
5523<x:ref>asterisk-form</x:ref> = "*"
5524<x:ref>authority</x:ref> = &lt;authority, defined in [RFC3986], Section 3.2&gt;
5525<x:ref>authority-form</x:ref> = authority
5527<x:ref>chunk</x:ref> = chunk-size [ chunk-ext ] CRLF chunk-data CRLF
5528<x:ref>chunk-data</x:ref> = 1*OCTET
5529<x:ref>chunk-ext</x:ref> = *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
5530<x:ref>chunk-ext-name</x:ref> = token
5531<x:ref>chunk-ext-val</x:ref> = token / quoted-string
5532<x:ref>chunk-size</x:ref> = 1*HEXDIG
5533<x:ref>chunked-body</x:ref> = *chunk last-chunk trailer-part CRLF
5534<x:ref>comment</x:ref> = "(" *( ctext / quoted-pair / comment ) ")"
5535<x:ref>connection-option</x:ref> = token
5536<x:ref>ctext</x:ref> = HTAB / SP / %x21-27 ; '!'-'''
5537 / %x2A-5B ; '*'-'['
5538 / %x5D-7E ; ']'-'~'
5539 / obs-text
5541<x:ref>field-content</x:ref> = field-vchar [ 1*( SP / HTAB ) field-vchar ]
5542<x:ref>field-name</x:ref> = token
5543<x:ref>field-value</x:ref> = *( field-content / obs-fold )
5544<x:ref>field-vchar</x:ref> = VCHAR / obs-text
5545<x:ref>fragment</x:ref> = &lt;fragment, defined in [RFC3986], Section 3.5&gt;
5547<x:ref>header-field</x:ref> = field-name ":" OWS field-value OWS
5548<x:ref>http-URI</x:ref> = "http://" authority path-abempty [ "?" query ] [ "#"
5549 fragment ]
5550<x:ref>https-URI</x:ref> = "https://" authority path-abempty [ "?" query ] [ "#"
5551 fragment ]
5553<x:ref>last-chunk</x:ref> = 1*"0" [ chunk-ext ] CRLF
5555<x:ref>message-body</x:ref> = *OCTET
5556<x:ref>method</x:ref> = token
5558<x:ref>obs-fold</x:ref> = CRLF 1*( SP / HTAB )
5559<x:ref>obs-text</x:ref> = %x80-FF
5560<x:ref>origin-form</x:ref> = absolute-path [ "?" query ]
5562<x:ref>partial-URI</x:ref> = relative-part [ "?" query ]
5563<x:ref>path-abempty</x:ref> = &lt;path-abempty, defined in [RFC3986], Section 3.3&gt;
5564<x:ref>port</x:ref> = &lt;port, defined in [RFC3986], Section 3.2.3&gt;
5565<x:ref>protocol</x:ref> = protocol-name [ "/" protocol-version ]
5566<x:ref>protocol-name</x:ref> = token
5567<x:ref>protocol-version</x:ref> = token
5568<x:ref>pseudonym</x:ref> = token
5570<x:ref>qdtext</x:ref> = HTAB / SP / "!" / %x23-5B ; '#'-'['
5571 / %x5D-7E ; ']'-'~'
5572 / obs-text
5573<x:ref>query</x:ref> = &lt;query, defined in [RFC3986], Section 3.4&gt;
5574<x:ref>quoted-pair</x:ref> = "\" ( HTAB / SP / VCHAR / obs-text )
5575<x:ref>quoted-string</x:ref> = DQUOTE *( qdtext / quoted-pair ) DQUOTE
5577<x:ref>rank</x:ref> = ( "0" [ "." *3DIGIT ] ) / ( "1" [ "." *3"0" ] )
5578<x:ref>reason-phrase</x:ref> = *( HTAB / SP / VCHAR / obs-text )
5579<x:ref>received-by</x:ref> = ( uri-host [ ":" port ] ) / pseudonym
5580<x:ref>received-protocol</x:ref> = [ protocol-name "/" ] protocol-version
5581<x:ref>relative-part</x:ref> = &lt;relative-part, defined in [RFC3986], Section 4.2&gt;
5582<x:ref>request-line</x:ref> = method SP request-target SP HTTP-version CRLF
5583<x:ref>request-target</x:ref> = origin-form / absolute-form / authority-form /
5584 asterisk-form
5586<x:ref>scheme</x:ref> = &lt;scheme, defined in [RFC3986], Section 3.1&gt;
5587<x:ref>segment</x:ref> = &lt;segment, defined in [RFC3986], Section 3.3&gt;
5588<x:ref>start-line</x:ref> = request-line / status-line
5589<x:ref>status-code</x:ref> = 3DIGIT
5590<x:ref>status-line</x:ref> = HTTP-version SP status-code SP reason-phrase CRLF
5592<x:ref>t-codings</x:ref> = "trailers" / ( transfer-coding [ t-ranking ] )
5593<x:ref>t-ranking</x:ref> = OWS ";" OWS "q=" rank
5594<x:ref>tchar</x:ref> = "!" / "#" / "$" / "%" / "&amp;" / "'" / "*" / "+" / "-" / "." /
5595 "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
5596<x:ref>token</x:ref> = 1*tchar
5597<x:ref>trailer-part</x:ref> = *( header-field CRLF )
5598<x:ref>transfer-coding</x:ref> = "chunked" / "compress" / "deflate" / "gzip" /
5599 transfer-extension
5600<x:ref>transfer-extension</x:ref> = token *( OWS ";" OWS transfer-parameter )
5601<x:ref>transfer-parameter</x:ref> = token BWS "=" BWS ( token / quoted-string )
5603<x:ref>uri-host</x:ref> = &lt;host, defined in [RFC3986], Section 3.2.2&gt;
5607<?ENDINC p1-messaging.abnf-appendix ?>
Note: See TracBrowser for help on using the repository browser.