draft-ietf-httpbis-bcp56bis-08.txt   draft-ietf-httpbis-bcp56bis-latest.txt 
HTTP Working Group M. Nottingham HTTP Working Group M. Nottingham
Internet-Draft November 9, 2018 Internet-Draft October 18, 2019
Obsoletes: 3205 (if approved) Obsoletes: 3205 (if approved)
Intended status: Best Current Practice Intended status: Best Current Practice
Expires: May 13, 2019 Expires: April 20, 2020
Building Protocols with HTTP Building Protocols with HTTP
draft-ietf-httpbis-bcp56bis-08 draft-ietf-httpbis-bcp56bis-latest
Abstract Abstract
HTTP is often used as a substrate for other application protocols HTTP is often used as a substrate for other application protocols
(a.k.a. HTTP-based APIs). This document specifies best practices (a.k.a. HTTP-based APIs). This document specifies best practices
for such protocols' use of HTTP when they are defined for diverse for writing specifications that use HTTP to define new application
protocols, especially when they are defined for diverse
implementation and broad deployment (e.g., in standards efforts). implementation and broad deployment (e.g., in standards efforts).
Note to Readers Note to Readers
Discussion of this draft takes place on the HTTP working group Discussion of this draft takes place on the HTTP working group
mailing list (ietf-http-wg@w3.org), which is archived at mailing list (ietf-http-wg@w3.org), which is archived at
https://lists.w3.org/Archives/Public/ietf-http-wg/ [1]. https://lists.w3.org/Archives/Public/ietf-http-wg/ [1].
Working Group information can be found at http://httpwg.github.io/ Working Group information can be found at http://httpwg.github.io/
[2]; source code and issues list for this draft can be found at [2]; source code and issues list for this draft can be found at
skipping to change at page 1, line 44 skipping to change at page 1, line 45
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on May 13, 2019. This Internet-Draft will expire on April 20, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Notational Conventions . . . . . . . . . . . . . . . . . 4 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 4
2. Is HTTP Being Used? . . . . . . . . . . . . . . . . . . . . . 4 2. Is HTTP Being Used? . . . . . . . . . . . . . . . . . . . . . 4
2.1. Non-HTTP Protocols . . . . . . . . . . . . . . . . . . . 5
3. What's Important About HTTP . . . . . . . . . . . . . . . . . 5 3. What's Important About HTTP . . . . . . . . . . . . . . . . . 5
3.1. Generic Semantics . . . . . . . . . . . . . . . . . . . . 5 3.1. Generic Semantics . . . . . . . . . . . . . . . . . . . . 5
3.2. Links . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.2. Links . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3. Rich Functionality . . . . . . . . . . . . . . . . . . . 7 3.3. Rich Functionality . . . . . . . . . . . . . . . . . . . 7
4. Best Practices for Using HTTP . . . . . . . . . . . . . . . . 8 4. Best Practices for Specifying the Use of HTTP . . . . . . . . 8
4.1. Specifying the Use of HTTP . . . . . . . . . . . . . . . 8 4.1. Specifying the Use of HTTP . . . . . . . . . . . . . . . 8
4.2. Defining HTTP Resources . . . . . . . . . . . . . . . . . 9 4.2. Specifying Server Behaviour . . . . . . . . . . . . . . . 9
4.3. Specifying Client Behaviours . . . . . . . . . . . . . . 9 4.3. Specifying Client Behaviour . . . . . . . . . . . . . . . 10
4.4. HTTP URLs . . . . . . . . . . . . . . . . . . . . . . . . 10 4.4. Specifying URLs . . . . . . . . . . . . . . . . . . . . . 11
4.4.1. Initial URL Discovery . . . . . . . . . . . . . . . . 11 4.4.1. Discovering an Application's URLs . . . . . . . . . . 11
4.4.2. URL Schemes . . . . . . . . . . . . . . . . . . . . . 11 4.4.2. Considering URI Schemes . . . . . . . . . . . . . . . 12
4.4.3. Transport Ports . . . . . . . . . . . . . . . . . . . 12 4.4.3. Transport Ports . . . . . . . . . . . . . . . . . . . 13
4.5. HTTP Methods . . . . . . . . . . . . . . . . . . . . . . 13 4.5. Using HTTP Methods . . . . . . . . . . . . . . . . . . . 13
4.5.1. GET . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.5.1. GET . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.5.2. OPTIONS . . . . . . . . . . . . . . . . . . . . . . . 14 4.5.2. OPTIONS . . . . . . . . . . . . . . . . . . . . . . . 15
4.6. HTTP Status Codes . . . . . . . . . . . . . . . . . . . . 15 4.6. Using HTTP Status Codes . . . . . . . . . . . . . . . . . 16
4.6.1. Redirection . . . . . . . . . . . . . . . . . . . . . 16 4.6.1. Redirection . . . . . . . . . . . . . . . . . . . . . 17
4.7. HTTP Header Fields . . . . . . . . . . . . . . . . . . . 17 4.7. Specifying HTTP Header Fields . . . . . . . . . . . . . . 18
4.8. Defining Message Payloads . . . . . . . . . . . . . . . . 18 4.8. Defining Message Payloads . . . . . . . . . . . . . . . . 19
4.9. HTTP Caching . . . . . . . . . . . . . . . . . . . . . . 18 4.9. Leveraging HTTP Caching . . . . . . . . . . . . . . . . . 19
4.10. Application State . . . . . . . . . . . . . . . . . . . . 20 4.9.1. Freshness . . . . . . . . . . . . . . . . . . . . . . 20
4.11. Client Authentication . . . . . . . . . . . . . . . . . . 21 4.9.2. Stale Responses . . . . . . . . . . . . . . . . . . . 20
4.12. Co-Existing with Web Browsing . . . . . . . . . . . . . . 21 4.9.3. Caching and Application Semantics . . . . . . . . . . 21
4.13. Application Boundaries . . . . . . . . . . . . . . . . . 23 4.9.4. Varying Content Based Upon the Request . . . . . . . 21
4.14. Server Push . . . . . . . . . . . . . . . . . . . . . . . 23 4.10. Handling Application State . . . . . . . . . . . . . . . 22
4.15. Versioning and Evolution . . . . . . . . . . . . . . . . 24 4.11. Client Authentication . . . . . . . . . . . . . . . . . . 22
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 4.12. Co-Existing with Web Browsing . . . . . . . . . . . . . . 22
6. Security Considerations . . . . . . . . . . . . . . . . . . . 25 4.13. Maintaining Application Boundaries . . . . . . . . . . . 24
6.1. Privacy Considerations . . . . . . . . . . . . . . . . . 25 4.14. Using Server Push . . . . . . . . . . . . . . . . . . . . 25
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.15. Allowing Versioning and Evolution . . . . . . . . . . . . 26
7.1. Normative References . . . . . . . . . . . . . . . . . . 26 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26
7.2. Informative References . . . . . . . . . . . . . . . . . 27 6. Security Considerations . . . . . . . . . . . . . . . . . . . 26
7.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 30 6.1. Privacy Considerations . . . . . . . . . . . . . . . . . 27
Appendix A. Changes from RFC 3205 . . . . . . . . . . . . . . . 30 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 27
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 30 7.1. Normative References . . . . . . . . . . . . . . . . . . 27
7.2. Informative References . . . . . . . . . . . . . . . . . 29
7.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Appendix A. Changes from RFC 3205 . . . . . . . . . . . . . . . 32
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 32
1. Introduction 1. Introduction
HTTP [I-D.ietf-httpbis-semantics] is often used as a substrate for HTTP [I-D.ietf-httpbis-semantics] is often used as a substrate for
applications other than Web browsing; this is sometimes referred to applications other than Web browsing; this is sometimes referred to
as creating "HTTP-based APIs", or just "HTTP APIs". This is done for as creating "HTTP-based APIs", or just "HTTP APIs". This is done for
a variety of reasons, including: a variety of reasons, including:
o familiarity by implementers, specifiers, administrators, o familiarity by implementers, specifiers, administrators,
developers and users, developers and users,
skipping to change at page 3, line 37 skipping to change at page 3, line 42
o availability of Web browsers, o availability of Web browsers,
o reuse of existing mechanisms like authentication and encryption, o reuse of existing mechanisms like authentication and encryption,
o presence of HTTP servers and clients in target deployments, and o presence of HTTP servers and clients in target deployments, and
o its ability to traverse firewalls. o its ability to traverse firewalls.
These protocols are often ad hoc; they are intended for only These protocols are often ad hoc; they are intended for only
deployment by one or a few servers, and consumption by a limited set deployment by one or a few servers, and consumption by a limited set
of clients. Perhaps because of the factors cited above, a body of of clients. As a result, a body of practices and tools has arisen
practices and tools has arisen around defining HTTP-based APIs that around defining HTTP-based APIs that favours these conditions.
favours these conditions.
However, when such an application has multiple, separate However, when such an application has multiple, separate
implementations of the server component, is deployed on multiple implementations, is deployed on multiple uncoordinated servers, and
uncoordinated servers, and is consumed by diverse clients - as is is consumed by diverse clients - as is often the case for HTTP APIs
often the case for standards efforts to define new HTTP APIs - tools defined by standards efforts - tools and practices intended for
and practices intended for limited deployment can become unsuitable. limited deployment can become unsuitable.
This is largely because implementations (both client and server) will This is largely because implementations (both client and server) will
implement and evolve at different paces. As a result, such an HTTP- implement and evolve at different paces. As a result, such an HTTP-
based API will need to more carefully consider how extensibility of based API will need to more carefully consider how extensibility of
the service will be handled and how different deployment requirements the service will be handled and how different deployment requirements
will be accommodated. will be accommodated.
More generally, application protocols using HTTP face a number of More generally, application protocols using HTTP face a number of
design decisions, including: design decisions, including:
o Should it define a new URL scheme? Use new ports? o Should it define a new URI scheme? Use new ports?
o Should it use standard HTTP methods and status codes, or define o Should it use standard HTTP methods and status codes, or define
new ones? new ones?
o How can the maximum value be extracted from the use of HTTP? o How can the maximum value be extracted from the use of HTTP?
o How does it coexist with other uses of HTTP - especially Web o How does it coexist with other uses of HTTP - especially Web
browsing? browsing?
o How can interoperability problems and "protocol dead ends" be o How can interoperability problems and "protocol dead ends" be
avoided? avoided?
This document contains best current practices regarding the use of This document contains best current practices for the specification
HTTP by applications other than Web browsing. Section 2 defines what of such applications. Section 2 defines when it applies; Section 3
applications it applies to; Section 3 surveys the properties of HTTP surveys the properties of HTTP that are important to preserve, and
that are important to preserve, and Section 4 conveys best practices Section 4 conveys best practices for the specifying them.
for those applications that do use HTTP.
It is written primarily to guide IETF efforts to define application It is written primarily to guide IETF efforts to define application
protocols using HTTP for deployment on the Internet, but might be protocols using HTTP for deployment on the Internet, but might be
applicable in other situations. Note that the requirements herein do applicable in other situations. Note that the requirements herein do
not necessarily apply to the development of generic HTTP extensions. not necessarily apply to the development of generic HTTP extensions.
1.1. Notational Conventions 1.1. Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
2. Is HTTP Being Used? 2. Is HTTP Being Used?
Different applications have different goals when using HTTP. The Different applications have different goals when using HTTP. The
requirements in this document apply when any of the following requirements in this document apply when a specification defines an
conditions are true: application that:
o The transport port in use is 80 or 443, o uses the transport port 80 or 443, or
o uses the URI scheme "http" or "https", or
o The URL scheme "http" or "https" is used, o uses an ALPN protocol ID [RFC7301] that generically identifies
HTTP (e.g., "http/1.1", "h2", "h2c"), or
o The ALPN protocol ID [RFC7301] generically identifies HTTP (e.g., o updates or modifies the IANA registries defined for HTTP.
"http/1.1", "h2", "h2c"), or
o The IANA registries defined for HTTP are updated or modified. Additionally, when a specification is using HTTP, all of the
requirements of the HTTP protocol suite are in force (including but
not limited to [I-D.ietf-httpbis-semantics],
[I-D.ietf-httpbis-cache], [I-D.ietf-httpbis-messaging], and
[RFC7540]).
When an application is using HTTP, all of the requirements of the Note that this document is intended to apply to applications, not
HTTP protocol suite are in force (including but not limited to generic extensions to HTTP, which follow the requirements in the
[I-D.ietf-httpbis-semantics], [I-D.ietf-httpbis-cache], relevant specification. Furthermore, it is intended for applications
[I-D.ietf-httpbis-messaging], and [RFC7540]). defined by IETF specifications, although other standards
organisations are encouraged to adhere to its requirements.
An application might not use HTTP according to this definition and 2.1. Non-HTTP Protocols
still rely upon the HTTP specifications in some manner. For example,
an application might wish to avoid re-specifying parts of the message
format, but change others; or, it might want to use a different set
of methods.
Such applications are referred to as "protocols based upon HTTP" in A specification might not use HTTP according to the criteria above
this document. These have more freedom to modify protocol and still define an application that relies upon HTTP in some manner.
operations, but are also likely to lose at least a portion of the For example, an application might wish to avoid re-specifying parts
benefits outlined above, as most HTTP implementations won't be easily of the message format, but change others; or, it might want to use a
adaptable to these changes, and as the protocol diverges from HTTP, different set of methods.
the benefit of mindshare will be lost.
Protocols that are based upon HTTP MUST NOT reuse HTTP's URL schemes, Doing so brings more freedom to modify protocol operations, but loses
transport ports, ALPN protocol IDs or IANA registries; rather, they at least a portion of the benefits outlined above, as most HTTP
are encouraged to establish their own. implementations won't be easily adaptable to these changes, and as
the protocol diverges from HTTP, the benefit of mindshare will be
lost.
3. What's Important About HTTP Such specifications MUST NOT reuse HTTP's URI schemes, transport
ports, ALPN protocol IDs or IANA registries; rather, they are
encouraged to establish their own.
Applications using HTTP are defined and deployed in many ways; 3. What's Important About HTTP
sometimes they are brought to the IETF for standardisation. What
might be workable for deployment in a limited fashion isn't
appropriate for standardisation and the corresponding broader
deployment.
This section examines the facets of the protocol that are important This section examines the facets of the protocol that are important
to preserve in these situations. to consider when using HTTP to define an application protocol.
3.1. Generic Semantics 3.1. Generic Semantics
When writing a specification, it's often tempting to specify exactly Much of the value of HTTP is in its generic semantics - that is, the
how HTTP is to be implemented, supported and used. protocol elements defined by HTTP are potentially applicable to every
resource, not specific to a particular context. Application-specific
semantics are best expressed in the payload; often in the body, but
also in header fields.
This generic/application-specific split allows a HTTP message to be
handled by software (e.g., HTTP servers, intermediaries, client
implementations, and caches) without understanding the specific
application. It also allows people to leverage their knowledge of
HTTP semantics without special-casing them for a particular
application.
Therefore, applications that use HTTP MUST NOT re-define, refine or
overlay the semantics of generic protocol elements such as methods,
status codes or existing header fields. Instead, they should focus
their specifications on protocol elements that are specific to that
application; namely their HTTP resources.
For example, when writing a specification, it's often tempting to
specify exactly how HTTP is to be implemented, supported and used.
However, this can easily lead to an unintended profile of HTTP's However, this can easily lead to an unintended profile of HTTP's
behaviour. For example, it's common to see specifications with behaviour. For example, it's common to see specifications with
language like this: language like this:
A `POST` request MUST result in a `201 Created` response. A `POST` request MUST result in a `201 Created` response.
This forms an expectation in the client that the response will always This forms an expectation in the client that the response will always
be "201 Created", when in fact there are a number of reasons why the be "201 Created", when in fact there are a number of reasons why the
status code might differ in a real deployment. If the client does status code might differ in a real deployment; for example, there
not anticipate this, the application's deployment is brittle. might be a proxy that requires authentication, or a server-side
error, or a redirection. If the client does not anticipate this, the
Much of the value of HTTP is in its generic semantics - that is, the application's deployment is brittle.
protocol elements defined by HTTP are potentially applicable to every
resource, not specific to a particular context. Application-specific
semantics are expressed in the payload; mostly, in the body, but also
in header fields.
This allows a HTTP message to be examined by generic software (e.g.,
HTTP servers, intermediaries, client implementations, and caches) and
its handling to be correctly determined. It also allows people to
leverage their knowledge of HTTP semantics without special-casing
them for a particular application.
Therefore, applications that use HTTP MUST NOT re-define, refine or
overlay the semantics of defined protocol elements. Instead, they
should focus their specifications on protocol elements that are
specific to that application; namely their HTTP resources.
See Section 4.2 for details. See Section 4.2 for more details.
3.2. Links 3.2. Links
Another common practice is assuming that the HTTP server's name space Another common practice is assuming that the HTTP server's name space
(or a portion thereof) is exclusively for the use of a single (or a portion thereof) is exclusively for the use of a single
application. This effectively overlays special, application-specific application. This effectively overlays special, application-specific
semantics onto that space, precludes other applications from using semantics onto that space, precludes other applications from using
it. it.
As explained in [RFC7320], such "squatting" on a part of the URL As explained in [RFC7320], such "squatting" on a part of the URL
space by a standard usurps the server's authority over its own space by a standard usurps the server's authority over its own
resources, can cause deployment issues, and is therefore bad practice resources, can cause deployment issues, and is therefore bad practice
in standards. in standards.
Instead of statically defining URL components like paths, it is Instead of statically defining URI components like paths, it is
RECOMMENDED that applications using HTTP define links in payloads, to RECOMMENDED that applications using HTTP define links in payloads, to
allow flexibility in deployment. allow flexibility in deployment.
Using runtime links in this fashion has a number of other benefits - Using runtime links in this fashion has a number of other benefits -
especially when an application is to have multiple implementations especially when an application is to have multiple implementations
and/or deployments (as is often the case for those that are and/or deployments (as is often the case for those that are
standardised). standardised).
For example, navigating with a link allows a request to be routed to For example, navigating with a link allows a request to be routed to
a different server without the overhead of a redirection, thereby a different server without the overhead of a redirection, thereby
skipping to change at page 7, line 38 skipping to change at page 8, line 4
o Content negotiation for format, language, and other features o Content negotiation for format, language, and other features
o Caching for server scalability, latency and bandwidth reduction, o Caching for server scalability, latency and bandwidth reduction,
and reliability and reliability
o Granularity of access control (through use of a rich space of o Granularity of access control (through use of a rich space of
URLs) URLs)
o Partial content to selectively request part of a response o Partial content to selectively request part of a response
o The ability to interact with the application easily using a Web o The ability to interact with the application easily using a Web
browser browser
Applications that use HTTP are encouraged to utilise the various Applications that use HTTP are encouraged to utilise the various
features that the protocol offers, so that their users receive the features that the protocol offers, so that their users receive the
maximum benefit from it, and to allow it to be deployed in a variety maximum benefit from it, and to allow it to be deployed in a variety
of situations. This document does not require specific features to of situations. This document does not require specific features to
be used, since the appropriate design tradeoffs are highly specific be used, since the appropriate design tradeoffs are highly specific
to a given situation. However, following the practices in Section 4 to a given situation. However, following the practices in Section 4
is a good starting point. is a good starting point.
4. Best Practices for Using HTTP 4. Best Practices for Specifying the Use of HTTP
This section contains best practices regarding the use of HTTP by This section contains best practices for specifying the use of HTTP
applications, including practices for specific HTTP protocol by applications, including practices for specific HTTP protocol
elements. elements.
4.1. Specifying the Use of HTTP 4.1. Specifying the Use of HTTP
When specifying the use of HTTP, an application SHOULD use When specifying the use of HTTP, an application should use
[I-D.ietf-httpbis-semantics] as the primary reference; it is not [I-D.ietf-httpbis-semantics] as the primary reference; it is not
necessary to reference all of the specifications in the HTTP suite necessary to reference all of the specifications in the HTTP suite
unless there are specific reasons to do so (e.g., a particular unless there are specific reasons to do so (e.g., a particular
feature is called out). feature is called out).
Applications using HTTP SHOULD NOT specify a minimum version of HTTP Because it is a hop-by-hop protocol, a HTTP connection can be handled
to be used; because it is a hop-by-hop protocol, a HTTP connection by implementations that are not controlled by the application; for
can be handled by implementations that are not controlled by the example, proxies, CDNs, firewalls and so on. Requiring a particular
application; for example, proxies, CDNs, firewalls and so on. version of HTTP makes it difficult to use in these situations, and
Requiring a particular version of HTTP makes it difficult to use in harms interoperability for little reason (since HTTP's semantics are
these situations, and harms interoperability for little reason (since stable between protocol versions). Therefore, it is RECOMMENDED that
HTTP's semantics are stable between protocol versions). applications using HTTP not specify a minimum version of HTTP to be
used.
However, if an application's deployment would benefit from the use of However, if an application's deployment would benefit from the use of
a particular version of HTTP (for example, HTTP/2's multiplexing), a particular version of HTTP (for example, HTTP/2's multiplexing),
this SHOULD be noted. this ought be noted.
Applications using HTTP MUST NOT specify a maximum version, to Applications using HTTP MUST NOT specify a maximum version, to
preserve the protocol's ability to evolve. preserve the protocol's ability to evolve.
When specifying examples of protocol interactions, applications When specifying examples of protocol interactions, applications
SHOULD document both the request and response messages, with full should document both the request and response messages, with full
headers, preferably in HTTP/1.1 format. For example: headers, preferably in HTTP/1.1 format. For example:
GET /thing HTTP/1.1 GET /thing HTTP/1.1
Host: example.com Host: example.com
Accept: application/things+json Accept: application/things+json
User-Agent: Foo/1.0 User-Agent: Foo/1.0
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/things+json Content-Type: application/things+json
Content-Length: 500 Content-Length: 500
Server: Bar/2.2 Server: Bar/2.2
[payload here] [payload here]
4.2. Defining HTTP Resources 4.2. Specifying Server Behaviour
Applications that use HTTP should focus on defining the following The most effective way to specify an application's server-side HTTP
application-specific protocol elements: behaviours is in terms of the following protocol elements:
o Media types [RFC6838], often based upon a format convention such o Media types [RFC6838], often based upon a format convention such
as JSON [RFC8259], as JSON [RFC8259],
o HTTP header fields, as per Section 4.7, and o HTTP header fields, as per Section 4.7, and
o The behaviour of resources, as identified by link relations o The behaviour of resources, as identified by link relations
[RFC8288]. [RFC8288].
By composing these protocol elements, an application can define a set By composing these protocol elements, an application can define a set
of resources, identified by link relations, that implement specified of resources, identified by link relations, that implement specified
behaviours, including: behaviours, including:
o Retrieval of their state using GET, in one or more formats o retrieval of their state using GET, in one or more formats
identified by media type; identified by media type;
o Resource creation or update using POST or PUT, with an o resource creation or update using POST or PUT, with an
appropriately identified request body format; appropriately identified request body format;
o Data processing using POST and identified request and response o data processing using POST and identified request and response
body format(s); and body format(s); and
o Resource deletion using DELETE. o Resource deletion using DELETE.
For example, an application might specify: For example, an application might specify:
Resources linked to with the "example-widget" link relation type are Resources linked to with the "example-widget" link relation type are
Widgets. The state of a Widget can be fetched in the Widgets. The state of a Widget can be fetched in the
"application/example-widget+json" format, and can be updated by PUT "application/example-widget+json" format, and can be updated by PUT
to the same link. Widget resources can be deleted. to the same link. Widget resources can be deleted.
The "Example-Count" response header field on Widget representations The "Example-Count" response header field on Widget representations
indicates how many Widgets are held by the sender. indicates how many Widgets are held by the sender.
The "application/example-widget+json" format is a JSON [RFC8259] The "application/example-widget+json" format is a JSON [RFC8259]
format representing the state of a Widget. It contains links to format representing the state of a Widget. It contains links to
related information in the link indicated by the Link header field related information in the link indicated by the Link header field
value with the "example-other-info" link relation type. value with the "example-other-info" link relation type.
4.3. Specifying Client Behaviours Applications can also specify the use of URI Templates [RFC6570] to
allow clients to generate URLs based upon runtime data.
Some behaviours (e.g., automatic redirect handling) and extensions 4.3. Specifying Client Behaviour
(e.g., Cookies) are not required by HTTP, but nevertheless have
become very common, possibly because they are supported by Web In general, applications using HTTP ought to align their expectations
browsers. If their use is not explicitly specified by applications for client behaviour as closely as possible with that of Web
using HTTP, there may be confusion and interoperability problems. browsers, to avoid interoperability issues when they are used.
This section recommends default handling for these mechanisms.
One way to do this is to define it in terms of [FETCH], since that is
the abstraction that browsers use for HTTP.
Some client behaviours (e.g., automatic redirect handling) and
extensions (e.g., Cookies) are not required by HTTP, but nevertheless
have become very common. If their use is not explicitly specified by
applications using HTTP, there may be confusion and interoperability
problems. In particular:
o Redirect handling - Applications need to specify how redirects are o Redirect handling - Applications need to specify how redirects are
expected to be handled; see Section 4.6.1. expected to be handled; see Section 4.6.1.
o Cookies - Applications using HTTP MUST explicitly reference the o Cookies - Applications using HTTP should explicitly reference the
Cookie specification [I-D.ietf-httpbis-rfc6265bis] if they are Cookie specification [I-D.ietf-httpbis-rfc6265bis] if they are
required. required.
o Certificates - Applications using HTTP MUST specify that TLS o Certificates - Applications using HTTP should specify that TLS
certificates are to be checked according to [RFC2818] when HTTPS certificates are to be checked according to [RFC2818] when HTTPS
is used. is used.
In general, applications using HTTP ought to align their usage as
closely as possible with Web browsers, to avoid interoperability
issues when they are used. See Section 4.12.
If an application using HTTP has browser compatibility as a goal,
client interaction ought to be defined in terms of [FETCH], since
that is the abstraction that browsers use for HTTP; it enforces many
of these best practices.
Applications using HTTP MUST NOT require HTTP features that are Applications using HTTP MUST NOT require HTTP features that are
usually negotiated to be supported by clients. For example, usually negotiated to be supported by clients. For example,
requiring that clients support responses with a certain content- requiring that clients support responses with a certain content-
coding ([I-D.ietf-httpbis-semantics], Section 6.2.2) instead of coding ([I-D.ietf-httpbis-semantics], Section 6.2.2) instead of
negotiating for it ({{?I-D.ietf-httpbis-semantics, Section 8.4.4) negotiating for it ([I-D.ietf-httpbis-semantics], Section 8.4.4)
means that otherwise conformant clients cannot interoperate with the means that otherwise conformant clients cannot interoperate with the
application. Applications MAY encourage the implementation of such application. Applications can encourage the implementation of such
features, though. features, though.
4.4. HTTP URLs 4.4. Specifying URLs
In HTTP, URLs are opaque identifiers under the control of the server.
As outlined in [RFC7320], standards cannot usurp this space, since it
might conflict with existing resources, and constrain implementation
and deployment.
In other words, applications that use HTTP shouldn't associate In HTTP, the server resources that clients interact with are
application semantics with specific URL paths on arbitrary servers. identified with URLs [RFC3986]. As [RFC7320] explains, parts of the
Doing so inappropriately conflates the identity of the resource (its URL are designed to be under the control of the owner (also known as
URL) with the capabilities that resource supports, bringing about the "authority") of that server, to give them the flexibility in
many of the same interoperability problems that [RFC4367] warns of. deployment.
For example, specifying that a "GET to the URL /foo retrieves a bar This means that in most cases, specifications for applications that
document" is bad practice. Likewise, specifying "The widget API is use HTTP won't contain its URLs; while it is common practice for a
at the path /bar" violates [RFC7320]. specification of a single-deployment API to specify the path prefix
"/app/v1" (for example), doing so in an IETF specification is
inappropriate.
Instead, applications are encouraged to ensure that URLs are Therefore, the specification writer needs some mechanism to allow
discovered at runtime, allowing HTTP-based services to describe their clients to discovery an application's URLs. Additionally, they need
own capabilities. One way to do this is to use typed links [RFC8288] to specify what URL scheme(s) the application should be used with,
to convey the URIs that are in use, as well as the semantics of the and whether to use a dedicated port, or reuse HTTP's port(s).
resources that they identify. See Section 4.2 for details.
4.4.1. Initial URL Discovery 4.4.1. Discovering an Application's URLs
Generally, a client will begin interacting with a given application Generally, a client will begin interacting with a given application
server by requesting an initial document that contains information server by requesting an initial document that contains information
about that particular deployment, potentially including links to about that particular deployment, potentially including links to
other relevant resources. other relevant resources. Doing so assures that the deployment is as
flexible as possible (potentially spanning multiple servers), allows
evolution, and also gives the application the opportunity to tailor
the 'discovery document' to the client.
Applications are encouraged to allow an arbitrary URL to be used as There are a few common patterns for discovering that initial URL.
that entry point. For example, rather than specifying "the initial
document is at "/foo/v1", they should allow a deployment to use any
URL as the entry point for the application.
In cases where doing so is impractical (e.g., it is not possible to The most straightforward mechanism for URL discovery is to configure
convey a whole URL, but only a hostname) applications can request a the client with (or otherwise convey to it) a full URL. This might
well-known URL [I-D.nottingham-rfc5785bis] as an entry point. be done in a configuration document, in DNS or mDNS, or through
another discovery mechanism.
4.4.2. URL Schemes However, if the client only knows the server's hostname and the
identity of the application, there needs to be some way to derive the
initial URL from that information.
Applications MUST NOT define a fixed prefix for its URL paths; for
reasons explained in [RFC7320], this is bad practice.
Instead, a specification for such an application can use one of the
following strategies:
o Register a Well-Known URI [I-D.nottingham-rfc5785bis] as an entry
point for that application. This provides a fixed path on every
potential server that will not collide with other applications.
o Enable the server authority to convey a URL Template [RFC6570] or
similar mechanism for generating a URL for an entry point. For
example, this might be done in a DNS RR, a configuration document,
or other artefact.
Once the discovery document is located, it can be fetched, cached for
later reuse (if allowed by its metadata), and used to locate other
resources that are relevant to the application, using full URIs or
URL Templates.
In some cases, an application may not wish to use such a discovery
document; for example, when communication is very brief, or when the
latency concerns of doing so precludes the use of a discovery
document. These situations can be addressed by placing all of the
application's resources under a well-known location.
4.4.2. Considering URI Schemes
Applications that use HTTP will typically employ the "http" and/or Applications that use HTTP will typically employ the "http" and/or
"https" URL schemes. "https" is RECOMMENDED to provide "https" URI schemes. "https" is RECOMMENDED to provide
authentication, integrity and confidentiality, as well as mitigate authentication, integrity and confidentiality, as well as mitigate
pervasive monitoring attacks [RFC7258]. pervasive monitoring attacks [RFC7258].
However, application-specific schemes can also be defined. When However, application-specific schemes can also be defined. When
defining an URL scheme for an application using HTTP, there are a defining an URI scheme for an application using HTTP, there are a
number of tradeoffs and caveats to keep in mind: number of tradeoffs and caveats to keep in mind:
o Unmodified Web browsers will not support the new scheme. While it o Unmodified Web browsers will not support the new scheme. While it
is possible to register new URL schemes with Web browsers (e.g. is possible to register new URI schemes with Web browsers (e.g.
registerProtocolHandler() in [HTML5], as well as several registerProtocolHandler() in [HTML], as well as several
proprietary approaches), support for these mechanisms is not proprietary approaches), support for these mechanisms is not
shared by all browsers, and their capabilities vary. shared by all browsers, and their capabilities vary.
o Existing non-browser clients, intermediaries, servers and o Existing non-browser clients, intermediaries, servers and
associated software will not recognise the new scheme. For associated software will not recognise the new scheme. For
example, a client library might fail to dispatch the request; a example, a client library might fail to dispatch the request; a
cache might refuse to store the response, and a proxy might fail cache might refuse to store the response, and a proxy might fail
to forward the request. to forward the request.
o Because URLs occur in HTTP artefacts commonly, often being o Because URLs occur in HTTP artefacts commonly, often being
skipping to change at page 12, line 30 skipping to change at page 13, line 25
[I-D.ietf-httpbis-rfc6265bis], authentication [I-D.ietf-httpbis-rfc6265bis], authentication
[I-D.ietf-httpbis-semantics], caching [I-D.ietf-httpbis-cache], [I-D.ietf-httpbis-semantics], caching [I-D.ietf-httpbis-cache],
HSTS [RFC6797], and CORS [FETCH] might or might not work HSTS [RFC6797], and CORS [FETCH] might or might not work
correctly, depending on how they are defined and implemented. correctly, depending on how they are defined and implemented.
Generally, they are designed and implemented with an assumption Generally, they are designed and implemented with an assumption
that the URL will always be "http" or "https". that the URL will always be "http" or "https".
o Web features that require a secure context [SECCTXT] will likely o Web features that require a secure context [SECCTXT] will likely
treat a new scheme as insecure. treat a new scheme as insecure.
See [RFC7595] for more information about minting new URL schemes. See [RFC7595] for more information about minting new URI schemes.
4.4.3. Transport Ports 4.4.3. Transport Ports
Applications can use the applicable default port (80 for HTTP, 443 Applications can use the applicable default port (80 for HTTP, 443
for HTTPS), or they can be deployed upon other ports. This decision for HTTPS), or they can be deployed upon other ports. This decision
can be made at deployment time, or might be encouraged by the can be made at deployment time, or might be encouraged by the
application's specification (e.g., by registering a port for that application's specification (e.g., by registering a port for that
application). application).
If a non-default port is used, it needs to be reflected in the If a non-default port is used, it needs to be reflected in the
skipping to change at page 13, line 5 skipping to change at page 13, line 47
changing a default port is changing the scheme (see Section 4.4.2). changing a default port is changing the scheme (see Section 4.4.2).
Using a port other than the default has privacy implications (i.e., Using a port other than the default has privacy implications (i.e.,
the protocol can now be distinguished from other traffic), as well as the protocol can now be distinguished from other traffic), as well as
operability concerns (as some networks might block or otherwise operability concerns (as some networks might block or otherwise
interfere with it). Privacy implications should be documented in interfere with it). Privacy implications should be documented in
Security Considerations. Security Considerations.
See [RFC7605] for further guidance. See [RFC7605] for further guidance.
4.5. HTTP Methods 4.5. Using HTTP Methods
Applications that use HTTP MUST confine themselves to using Applications that use HTTP MUST confine themselves to using
registered HTTP methods such as GET, POST, PUT, DELETE, and PATCH. registered HTTP methods such as GET, POST, PUT, DELETE, and PATCH.
New HTTP methods are rare; they are required to be registered in the New HTTP methods are rare; they are required to be registered in the
HTTP Method Registry with IETF Review (see HTTP Method Registry with IETF Review (see
[I-D.ietf-httpbis-semantics]), and are also required to be generic. [I-D.ietf-httpbis-semantics]), and are also required to be generic.
That means that they need to be potentially applicable to all That means that they need to be potentially applicable to all
resources, not just those of one application. resources, not just those of one application.
While historically some applications (e.g., [RFC4791]) have defined While historically some applications (e.g., [RFC4791]) have defined
non-generic methods, [I-D.ietf-httpbis-semantics] now forbids this. non-generic methods, [I-D.ietf-httpbis-semantics] now forbids this.
When authors believe that a new method is required, they are When authors believe that a new method is required, they are
encouraged to engage with the HTTP community early, and document encouraged to engage with the HTTP community early, and document
their proposal as a separate HTTP extension, rather than as part of their proposal as a separate HTTP extension, rather than as part of
an application's specification. an application's specification.
4.5.1. GET 4.5.1. GET
GET is one of the most common and useful HTTP methods; its retrieval GET is the most common and useful HTTP method; its retrieval
semantics allow caching, side-effect free linking and underlies many semantics allow caching, side-effect free linking and underlies many
of the benefits of using HTTP. of the benefits of using HTTP.
A common use of GET is to perform queries, often using the query A common use of GET is to perform queries, often using the query
component of the URL; this is a familiar pattern from Web browsing, component of the URL; this is a familiar pattern from Web browsing,
and the results can be cached, improving efficiency of an often and the results can be cached, improving efficiency of an often
expensive process. expensive process.
In some cases, however, GET might be unwieldy for expressing queries, In some cases, however, GET might be unwieldy for expressing queries,
because of the limited syntax of the URL; in particular, if binary because of the limited syntax of the URI; in particular, if binary
data forms part of the query terms, it needs to be encoded to conform data forms part of the query terms, it needs to be encoded to conform
to URL syntax. to URI syntax.
While this is not an issue for short queries, it can become one for While this is not an issue for short queries, it can become one for
larger query terms, or ones which need to sustain a high rate of larger query terms, or ones which need to sustain a high rate of
requests. Additionally, some HTTP implementations limit the size of requests. Additionally, some HTTP implementations limit the size of
URLs they support - although modern HTTP software has much more URLs they support - although modern HTTP software has much more
generous limits than previously (typically, considerably more than generous limits than previously (typically, considerably more than
8000 octets, as required by [I-D.ietf-httpbis-semantics]. 8000 octets, as required by [I-D.ietf-httpbis-semantics].
In these cases, an application using HTTP might consider using POST In these cases, an application using HTTP might consider using POST
to express queries in the request body; doing so avoids encoding to express queries in the request body; doing so avoids encoding
overhead and URL length limits in implementations. However, in doing overhead and URL length limits in implementations. However, in doing
so it should be noted that the benefits of GET such as caching and so it should be noted that the benefits of GET such as caching and
linking to query results are lost. Therefore, applications using linking to query results are lost. Therefore, applications using
HTTP that feel a need to allow POST queries ought consider allowing HTTP that feel a need to allow POST queries ought consider allowing
both methods. both methods.
Applications SHOULD NOT define GET requests to have side effects, Applications should not change their state or have other side effects
since implementations can and do retry HTTP GET requests that fail. that might be significant to the client, since implementations can
and do retry HTTP GET requests that fail. Note that this does not
include logging and similar functions; see
[I-D.ietf-httpbis-semantics], Section 7.2.1.
Finally, note that while HTTP allows GET requests to have a body Finally, note that while HTTP allows GET requests to have a body
syntactically, this is done only to allow parsers to be generic; as syntactically, this is done only to allow parsers to be generic; as
per [I-D.ietf-httpbis-semantics], Section 7.3.1, a body on a GET has per [I-D.ietf-httpbis-semantics], Section 7.3.1, a body on a GET has
no meaning, and will be either ignored or rejected by generic HTTP no meaning, and will be either ignored or rejected by generic HTTP
software. software.
4.5.2. OPTIONS 4.5.2. OPTIONS
The OPTIONS method was defined for metadata retrieval, and is used The OPTIONS method was defined for metadata retrieval, and is used
skipping to change at page 15, line 8 skipping to change at page 16, line 5
[I-D.nottingham-rfc5785bis], or using an already existing one if [I-D.nottingham-rfc5785bis], or using an already existing one if
it's appropriate (e.g., HostMeta [RFC6415]). it's appropriate (e.g., HostMeta [RFC6415]).
o For metadata about a specific resource, create a separate resource o For metadata about a specific resource, create a separate resource
and link to it using a Link response header or a link serialised and link to it using a Link response header or a link serialised
into the representation's body. See [RFC8288]. Note that the into the representation's body. See [RFC8288]. Note that the
Link header is available on HEAD responses, which is useful if the Link header is available on HEAD responses, which is useful if the
client wants to discover a resource's capabilities before they client wants to discover a resource's capabilities before they
interact with it. interact with it.
4.6. HTTP Status Codes 4.6. Using HTTP Status Codes
The primary function of a HTTP status code is to convey semantics for HTTP status codes convey semantics both for the benefit of generic
the benefit of generic HTTP software, not to convey application- HTTP components - such as caches, intermediaries, and clients - and
specific semantics. applications themselves. However, applications can encounter a
number of pitfalls in their use.
Status codes are often generated or overwritten by intermediaries, as First, status codes are often generated by intermediaries, as well as
well as server and client implementations. This can happen, for server and client implementations. This can happen, for example,
example, when network errors are encountered, a captive portal is when network errors are encountered, a captive portal is present,
present, when an implementation is overloaded, or it thinks it is when an implementation is overloaded, or it thinks it is under
under attack. As a result, the status code that a server-side attack. As a result, if an application assigns specific semantics to
application generates and the one that the client software receives one of these status codes, a client can be misled about its state,
often differ. because the status code was generated by a generic component, not the
application itself.
This means that status codes are not a reliable way to carry Furthermore, mapping application errors to individual HTTP status
application-specific signals. Specifying that a particular status codes one-to-one often leads to a situation where the finite space of
code has a specific meaning in the context of an application can have applicable HTTP status codes is exhausted. This, in turn, leads to a
unintended side effects; if that status code is generated by a number of bad practices - including minting new, application-specific
generic HTTP component can lead clients to believe that the status codes, or using existing status codes even though the link
application is in a state that wasn't intended. between their semantics and the application's is tenuous at best.
Instead, applications using HTTP should specify the implications of Instead, applications using HTTP should define their errors to use
general classes of responses (e.g., "successful response" for 2xx; the most applicable status code, making generous use of the general
"client error" for 4xx and "server error" for 5xx), conveying any status codes (200, 400 and 500) when in doubt. Importantly, they
application-specific information in the message body and/or HTTP should not specify a one-to-one relationship between status codes and
header fields, not the status code. [RFC7807] provides one way for application errors, thereby avoiding the exhaustion issue outlined
applications using HTTP to do so for error conditions. above.
There are limited exceptions to this; for example, applications might To distinguish between multiple error conditions that are mapped to
use 201 (Created) or 404 (Not Found) to convey application semantics the same status code, and to avoid the misattribution issue outlined
that are compatible with the generic HTTP semantics of those status above, applications using HTTP should convey finer-grained error
codes. In general, though, applications should resist the temptation information in the response's message body and/or header fields.
to map their semantics into fine-grained status codes. [RFC7807] provides one way to do so.
Because the set of registered HTTP status codes can expand, Because the set of registered HTTP status codes can expand,
applications using HTTP should explicitly point out that clients applications using HTTP should explicitly point out that clients
ought to be able to handle all applicable status codes gracefully ought to be able to handle all applicable status codes gracefully
(i.e., falling back to the generic "n00" semantics of a given status (i.e., falling back to the generic "n00" semantics of a given status
code; e.g., "499" can be safely handled as "400" by clients that code; e.g., "499" can be safely handled as "400" by clients that
don't recognise it). This is preferable to creating a "laundry list" don't recognise it). This is preferable to creating a "laundry list"
of potential status codes, since such a list is never complete. of potential status codes, since such a list won't be complete in the
foreseeable future.
Applications using HTTP MUST NOT re-specify the semantics of HTTP Applications using HTTP MUST NOT re-specify the semantics of HTTP
status codes, even if it is only by copying their definition. They status codes, even if it is only by copying their definition. It is
MUST NOT require specific reason phrases to be used; the reason RECOMMENDED they require specific reason phrases to be used; the
phrase has no function in HTTP, is not guaranteed to be preserved by reason phrase has no function in HTTP, is not guaranteed to be
implementations, and the reason phrase is not carried at all in the preserved by implementations, and is not carried at all in the HTTP/2
HTTP/2 [RFC7540] message format. [RFC7540] message format.
Applications MUST only use registered HTTP status codes. As with Applications MUST only use registered HTTP status codes. As with
methods, new HTTP status codes are rare, and required (by methods, new HTTP status codes are rare, and required (by
[I-D.ietf-httpbis-semantics]) to be registered with IETF Review. [I-D.ietf-httpbis-semantics]) to be registered with IETF Review.
Similarly, HTTP status codes are generic; they are required (by Similarly, HTTP status codes are generic; they are required (by
[I-D.ietf-httpbis-semantics]) to be potentially applicable to all [I-D.ietf-httpbis-semantics]) to be potentially applicable to all
resources, not just to those of one application. resources, not just to those of one application.
When authors believe that a new status code is required, they are When authors believe that a new status code is required, they are
encouraged to engage with the HTTP community early, and document encouraged to engage with the HTTP community early, and document
their proposal as a separate HTTP extension, rather than as part of their proposal as a separate HTTP extension, rather than as part of
an application's specification. an application's specification.
4.6.1. Redirection 4.6.1. Redirection
The 3xx series of status codes specified in The 3xx series of status codes specified in Section 9.4
[I-D.ietf-httpbis-semantics], Section 9.4 direct the user agent to [I-D.ietf-httpbis-semantics] direct the user agent to another
another resource to satisfy the request. The most common of these resource to satisfy the request. The most common of these are 301,
are 301, 302, 307 and 308 ([RFC7538]), all of which use the Location 302, 307 and 308, all of which use the Location response header field
response header field to indicate where the client should send the to indicate where the client should send the request to.
request to.
There are two ways that this group of status codes differ: There are two ways that this group of status codes differ:
o Whether they are permanent or temporary. Permanent redirects can o Whether they are permanent or temporary. Permanent redirects can
be used to update links stored in the client (e.g., bookmarks), be used to update links stored in the client (e.g., bookmarks),
whereas temporary ones can not. Note that this has no effect on whereas temporary ones can not. Note that this has no effect on
HTTP caching; it is completely separate. HTTP caching; it is completely separate.
o Whether they allow the redirected request to change the request o Whether they allow the redirected request to change the request
method from POST to GET. Web browsers generally do change POST to method from POST to GET. Web browsers generally do change POST to
skipping to change at page 17, line 12 skipping to change at page 18, line 12
| method | | | | method | | |
+-------------------------------------------+-----------+-----------+ +-------------------------------------------+-----------+-----------+
As noted in [I-D.ietf-httpbis-semantics], a user agent is allowed to As noted in [I-D.ietf-httpbis-semantics], a user agent is allowed to
automatically follow a 3xx redirect that has a Location response automatically follow a 3xx redirect that has a Location response
header field, even if they don't understand the semantics of the header field, even if they don't understand the semantics of the
specific status code. However, they aren't required to do so; specific status code. However, they aren't required to do so;
therefore, if an application using HTTP desires redirects to be therefore, if an application using HTTP desires redirects to be
automatically followed, it needs to explicitly specify the automatically followed, it needs to explicitly specify the
circumstances when this is required. circumstances when this is required.
Applications using HTTP SHOULD specify that 301 and 302 responses Applications using HTTP are encouraged to specify that 301 and 302
change the subsequent request method from POST (but no other method) responses change the subsequent request method from POST (but no
to GET, to be compatible with browsers. other method) to GET, to be compatible with browsers.
Generally, when a redirected request is made, its header fields are Generally, when a redirected request is made, its header fields are
copied from the original request's. However, they can be modified by copied from the original request's. However, they can be modified by
various mechanisms; e.g., sent Authorization various mechanisms; e.g., sent Authorization
([I-D.ietf-httpbis-semantics]) and Cookie ([I-D.ietf-httpbis-semantics]) and Cookie
([I-D.ietf-httpbis-rfc6265bis]) headers will change if the origin ([I-D.ietf-httpbis-rfc6265bis]) headers will change if the origin
(and sometimes path) of the request changes. Applications using HTTP (and sometimes path) of the request changes. An application using
SHOULD specify if any request headers need to be modified or removed HTTP should specify if any request headers that it defines need to be
upon a redirect; however, this behaviour cannot be relied upon, since modified or removed upon a redirect; however, this behaviour cannot
a generic client (like a browser) will be unaware of such be relied upon, since a generic client (like a browser) will be
requirements. unaware of such requirements.
4.7. HTTP Header Fields 4.7. Specifying HTTP Header Fields
Applications MAY define new HTTP header fields. Typically, using Applications often define new HTTP header fields. Typically, using
HTTP header fields is appropriate in a few different situations: HTTP header fields is appropriate in a few different situations:
o Their content is useful to intermediaries (who often wish to avoid o Their content is useful to intermediaries (who often wish to avoid
parsing the body), and/or parsing the body), and/or
o Their content is useful to generic HTTP software (e.g., clients, o Their content is useful to generic HTTP software (e.g., clients,
servers), and/or servers), and/or
o It is not possible to include their content in the message body o It is not possible to include their content in the message body
(usually because a format does not allow it). (usually because a format does not allow it).
When the conditions above are not met, it is usually better to convey
application-specific information in other places; e.g., the message
body or the URL query string.
New header fields MUST be registered, as per New header fields MUST be registered, as per
[I-D.ietf-httpbis-semantics]. [I-D.ietf-httpbis-semantics].
See [I-D.ietf-httpbis-semantics], Section 4.1.3 for guidelines to See [I-D.ietf-httpbis-semantics], Section 4.1.3 for guidelines to
consider when minting new header fields. consider when minting new header fields.
[I-D.ietf-httpbis-header-structure] provides a common structure for [I-D.ietf-httpbis-header-structure] provides a common structure for
new header fields, and avoids many issues in their parsing and new header fields, and avoids many issues in their parsing and
handling; it is RECOMMENDED that new header fields use it. handling; it is RECOMMENDED that new header fields use it.
It is RECOMMENDED that header field names be short (even when HTTP/2 It is RECOMMENDED that header field names be short (even when HTTP/2
header compression is in effect, there is an overhead) but header compression is in effect, there is an overhead) but
appropriately specific. In particular, if a header field is specific appropriately specific. In particular, if a header field is specific
to an application, an identifier for that application SHOULD form a to an application, an identifier for that application can form a
prefix to the header field name, separated by a "-". prefix to the header field name, separated by a "-".
For example, if the "example" application needs to create three For example, if the "example" application needs to create three
headers, they might be called "example-foo", "example-bar" and headers, they might be called "example-foo", "example-bar" and
"example-baz". Note that the primary motivation here is to avoid "example-baz". Note that the primary motivation here is to avoid
consuming more generic header names, not to reserve a portion of the consuming more generic header names, not to reserve a portion of the
namespace for the application; see [RFC6648] for related namespace for the application; see [RFC6648] for related
considerations. considerations.
The semantics of existing HTTP header fields MUST NOT be re-defined The semantics of existing HTTP header fields MUST NOT be re-defined
skipping to change at page 18, line 34 skipping to change at page 19, line 39
See Section 4.10 for considerations regarding header fields that See Section 4.10 for considerations regarding header fields that
carry application state (e.g., Cookie). carry application state (e.g., Cookie).
4.8. Defining Message Payloads 4.8. Defining Message Payloads
There are many potential formats for payloads; for example, JSON There are many potential formats for payloads; for example, JSON
[RFC8259], XML [XML], and CBOR [RFC7049]. Best practices for their [RFC8259], XML [XML], and CBOR [RFC7049]. Best practices for their
use are out of scope for this document. use are out of scope for this document.
Applications SHOULD register distinct media types for each format Applications should register distinct media types for each format
they define; this makes it possible to identify them unambiguously they define; this makes it possible to identify them unambiguously
and negotiate for their use. See [RFC6838] for more information. and negotiate for their use. See [RFC6838] for more information.
4.9. HTTP Caching 4.9. Leveraging HTTP Caching
HTTP caching [I-D.ietf-httpbis-cache] is one of the primary benefits HTTP caching [I-D.ietf-httpbis-cache] is one of the primary benefits
of using HTTP for applications; it provides scalability, reduces of using HTTP for applications; it provides scalability, reduces
latency and improves reliability. Furthermore, HTTP caches are latency and improves reliability. Furthermore, HTTP caches are
readily available in browsers and other clients, networks as forward readily available in browsers and other clients, networks as forward
and reverse proxies, Content Delivery Networks and as part of server and reverse proxies, Content Delivery Networks and as part of server
software. software.
Assigning even a short freshness lifetime ([I-D.ietf-httpbis-cache], Even when an application using HTTP isn't designed to take advantage
Section 4.2) - e.g., 5 seconds - allows a response to be reused to of caching, it needs to consider how caches will handle its
satisfy multiple clients, and/or a single client making the same responses, to preserve correct behaviour when one is interposed
request repeatedly. In general, if it is safe to reuse something, (whether in the network, server, client, or intervening
consider assigning a freshness lifetime; cache implementations take infrastructure).
active measures to remove content intelligently when they are out of
space, so "it will fill up the cache" is not a valid concern. 4.9.1. Freshness
Assigning even a short freshness lifetime (Section 4.2 of
[I-D.ietf-httpbis-cache]) - e.g., 5 seconds - allows a response to be
reused to satisfy multiple clients, and/or a single client making the
same request repeatedly. In general, if it is safe to reuse
something, consider assigning a freshness lifetime.
The most common method for specifying freshness is the max-age The most common method for specifying freshness is the max-age
response directive ([I-D.ietf-httpbis-cache], Section 5.2.2.8). The response directive (Section 5.2.2.8 of [I-D.ietf-httpbis-cache]).
Expires header ([I-D.ietf-httpbis-cache], Section 5.3) can also be The Expires header (Section 5.3 of [I-D.ietf-httpbis-cache]) can also
used, but it is not necessary to specify it; all modern cache be used, but it is not necessary; all modern cache implementations
implementations support Cache-Control, and specifying freshness as a support Cache-Control, and specifying freshness as a delta is usually
delta is usually more convenient and always less error-prone. more convenient and less error-prone.
Understand that stale responses (e.g., with "Cache-Control: max- In some situations, responses without explicit cache freshness
age=0") can be reused when the cache is disconnected from the origin directives will be stored and served using a heuristic freshness
server; this can be useful for handling network issues. See lifetime; see [I-D.ietf-httpbis-cache], Section 4.2.2. As the
[I-D.ietf-httpbis-cache], Section 4.2.4, and also [RFC5861] for heuristic is not under control of the application, it is generally
additional controls over stale content. preferable to set an explicit freshness lifetime, or make the
response explicitly uncacheable.
If caching of a response is not desired, the appropriate response
directive is "Cache-Control: no-store". This only need be sent in
situations where the response might be cached; see
[I-D.ietf-httpbis-cache], Section 3. Note that "Cache-Control: no-
cache" allows a response to be stored, just not reused by a cache
without validation; it does not prevent caching (despite its name).
For example, this response cannot be stored or reused by a cache:
HTTP/1.1 200 OK
Content-Type: application/example+xml
Cache-Control: no-store
[content]
4.9.2. Stale Responses
Authors should understand that stale responses (e.g., with "Cache-
Control: max-age=0") can be reused by caches when disconnected from
the origin server; this can be useful for handling network issues.
If doing so is not suitable for a given response, the origin should
use "Cache-Control: must-revalidate". See [I-D.ietf-httpbis-cache],
Section 4.2.4, and also [RFC5861] for additional controls over stale
content.
Stale responses can be refreshed by assigning a validator, saving Stale responses can be refreshed by assigning a validator, saving
both transfer bandwidth and latency for large responses; see both transfer bandwidth and latency for large responses; see
[I-D.ietf-httpbis-semantics]. [I-D.ietf-httpbis-semantics].
4.9.3. Caching and Application Semantics
When an application has a need to express a lifetime that's separate
from the freshness lifetime, this should be conveyed separately,
either in the response's body or in a separate header field. When
this happens, the relationship between HTTP caching and that lifetime
need to be carefully considered, since the response will be used as
long as it is considered fresh.
In particular, application authors need to consider how responses
that are not freshly obtained from the origin server should be
handled; if they have a concept like a validity period, this will
need to be calculated considering the age of the response (see
Section 4.2.3 of [I-D.ietf-httpbis-cache]).
One way to address this is to explicitly specify that all responses
be fresh upon use.
4.9.4. Varying Content Based Upon the Request
If an application uses a request header field to change the If an application uses a request header field to change the
response's headers or body, authors should point out that this has response's headers or body, authors should point out that this has
implications for caching; in general, such resources need to either implications for caching; in general, such resources need to either
make their responses uncacheable (e.g., with the "no-store" cache- make their responses uncacheable (e.g., with the "no-store" cache-
control directive defined in [I-D.ietf-httpbis-cache], control directive defined in [I-D.ietf-httpbis-cache],
Section 5.2.2.3) or send the Vary response header Section 5.2.2.3) or send the Vary response header
([I-D.ietf-httpbis-semantics], Section 10.1.4) on all responses from ([I-D.ietf-httpbis-semantics], Section 10.1.4) on all responses from
that resource (including the "default" response). that resource (including the "default" response).
For example, this response: For example, this response:
skipping to change at page 19, line 42 skipping to change at page 22, line 4
For example, this response: For example, this response:
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/example+xml Content-Type: application/example+xml
Cache-Control: max-age=60 Cache-Control: max-age=60
ETag: "sa0f8wf20fs0f" ETag: "sa0f8wf20fs0f"
Vary: Accept-Encoding Vary: Accept-Encoding
[content] [content]
can be stored for 60 seconds by both private and shared caches, can can be stored for 60 seconds by both private and shared caches, can
be revalidated with If-None-Match, and varies on the Accept-Encoding be revalidated with If-None-Match, and varies on the Accept-Encoding
request header field. request header field.
In some situations, responses without explicit cache directives 4.10. Handling Application State
(e.g., Cache-Control or Expires) will be stored and served using a
heuristic freshness lifetime; see [I-D.ietf-httpbis-cache],
Section 4.2.2. As the heuristic is not under control of the
application, it is generally preferable to set an explicit freshness
lifetime.
If caching of a response is not desired, the appropriate response
directive is "Cache-Control: no-store". This only need be sent in
situations where the response might be cached; see
[I-D.ietf-httpbis-cache], Section 3. Note that "Cache-Control: no-
cache" allows a response to be stored, just not reused by a cache; it
does not prevent caching (despite its name).
For example, this response cannot be stored or reused by a cache:
HTTP/1.1 200 OK
Content-Type: application/example+xml
Cache-Control: no-store
[content]
When an application has a need to express a lifetime that's separate
from the freshness lifetime, this should be expressed separately,
either in the response's body or in a separate header field. When
this happens, the relationship between HTTP caching and that lifetime
need to be carefully considered, since the response will be used as
long as it is considered fresh.
Like other functions, HTTP caching is generic; it does not have
knowledge of the application in use. Therefore, caching extensions
need to be backwards-compatible, as per [I-D.ietf-httpbis-cache],
Section 5.2.3.
4.10. Application State
Applications MAY use stateful cookies [I-D.ietf-httpbis-rfc6265bis] Applications can use stateful cookies [I-D.ietf-httpbis-rfc6265bis]
to identify a client and/or store client-specific data to to identify a client and/or store client-specific data to
contextualise requests. contextualise requests.
When used, it is important to carefully specify the scoping and use When used, it is important to carefully specify the scoping and use
of cookies; if the application exposes sensitive data or capabilities of cookies; if the application exposes sensitive data or capabilities
(e.g., by acting as an ambient authority), exploits are possible. (e.g., by acting as an ambient authority), exploits are possible.
Mitigations include using a request-specific token to assure the Mitigations include using a request-specific token to assure the
intent of the client. intent of the client.
Applications MUST NOT make assumptions about the relationship between Applications MUST NOT make assumptions about the relationship between
separate requests on a single transport connection; doing so breaks separate requests on a single transport connection; doing so breaks
many of the assumptions of HTTP as a stateless protocol, and will many of the assumptions of HTTP as a stateless protocol, and will
cause problems in interoperability, security, operability and cause problems in interoperability, security, operability and
evolution. evolution.
4.11. Client Authentication 4.11. Client Authentication
Applications MAY use HTTP authentication [I-D.ietf-httpbis-semantics] Applications can use HTTP authentication [I-D.ietf-httpbis-semantics]
to identify clients. The Basic authentication scheme [RFC7617] MUST to identify clients. The Basic authentication scheme [RFC7617] MUST
NOT be used unless the underlying transport is authenticated, NOT be used unless the underlying transport is authenticated,
integrity-protected and confidential (e.g., as provided the "HTTPS" integrity-protected and confidential (e.g., as provided the "HTTPS"
URL scheme, or another using TLS). The Digest scheme [RFC7616] MUST URI scheme, or another using TLS). The Digest scheme [RFC7616] MUST
NOT be used unless the underlying transport is similarly secure, or NOT be used unless the underlying transport is similarly secure, or
the chosen hash algorithm is not "MD5". the chosen hash algorithm is not "MD5".
With HTTPS, clients might also be authenticated using certificates With HTTPS, clients might also be authenticated using certificates
[RFC5246]. [RFC5246].
When used, it is important to carefully specify the scoping and use When used, it is important to carefully specify the scoping and use
of authentication; if the application exposes sensitive data or of authentication; if the application exposes sensitive data or
capabilities (e.g., by acting as an ambient authority), exploits are capabilities (e.g., by acting as an ambient authority), exploits are
possible. Mitigations include using a request-specific token to possible. Mitigations include using a request-specific token to
skipping to change at page 22, line 6 skipping to change at page 23, line 29
This is only a small sample of the kinds of issues that applications This is only a small sample of the kinds of issues that applications
using HTTP must consider. Generally, the best approach is to using HTTP must consider. Generally, the best approach is to
consider the application actually as a Web application, and to follow consider the application actually as a Web application, and to follow
best practices for their secure development. best practices for their secure development.
A complete enumeration of such practices is out of scope for this A complete enumeration of such practices is out of scope for this
document, but some considerations include: document, but some considerations include:
o Using an application-specific media type in the Content-Type o Using an application-specific media type in the Content-Type
header, and requiring clients to fail if it is not used header, and requiring clients to fail if it is not used.
o Using X-Content-Type-Options: nosniff [FETCH] to assure that o Using X-Content-Type-Options: nosniff [FETCH] to assure that
content under attacker control can't be coaxed into a form that is content under attacker control can't be coaxed into a form that is
interpreted as active content by a Web browser interpreted as active content by a Web browser.
o Using Content-Security-Policy [CSP] to constrain the capabilities o Using Content-Security-Policy [CSP] to constrain the capabilities
of active content (such as HTML [HTML5]), thereby mitigating of active content (such as HTML [HTML]), thereby mitigating Cross-
Cross-Site Scripting attacks Site Scripting attacks.
o Using Referrer-Policy [REFERRER-POLICY] to prevent sensitive data o Using Referrer-Policy [REFERRER-POLICY] to prevent sensitive data
in URLs from being leaked in the Referer request header in URLs from being leaked in the Referer request header.
o Using the 'HttpOnly' flag on Cookies to assure that cookies are o Using the 'HttpOnly' flag on Cookies to assure that cookies are
not exposed to browser scripting languages not exposed to browser scripting languages
[I-D.ietf-httpbis-rfc6265bis] [I-D.ietf-httpbis-rfc6265bis].
o Avoiding use of compression on any sensitive information (e.g., o Avoiding use of compression on any sensitive information (e.g.,
authentication tokens, passwords), as the scripting environment authentication tokens, passwords), as the scripting environment
offered by Web browsers allows an attacker to repeatedly probe the offered by Web browsers allows an attacker to repeatedly probe the
compression space; if the attacker has access to the path of the compression space; if the attacker has access to the path of the
communication, they can use this capability to recover that communication, they can use this capability to recover that
information information.
Depending on how they are intended to be deployed, specifications for Depending on how they are intended to be deployed, specifications for
applications using HTTP might require the use of these mechanisms in applications using HTTP might require the use of these mechanisms in
specific ways, or might merely point them out in Security specific ways, or might merely point them out in Security
Considerations. Considerations.
An example of a HTTP response from an application that does not An example of a HTTP response from an application that does not
intend for its content to be treated as active by browsers might look intend for its content to be treated as active by browsers might look
like this: like this:
skipping to change at page 23, line 5 skipping to change at page 24, line 28
Cache-Control: max-age=3600 Cache-Control: max-age=3600
Referrer-Policy: no-referrer Referrer-Policy: no-referrer
[content] [content]
If an application has browser compatibility as a goal, client If an application has browser compatibility as a goal, client
interaction ought to be defined in terms of [FETCH], since that is interaction ought to be defined in terms of [FETCH], since that is
the abstraction that browsers use for HTTP; it enforces many of these the abstraction that browsers use for HTTP; it enforces many of these
best practices. best practices.
4.13. Application Boundaries 4.13. Maintaining Application Boundaries
Because the origin [RFC6454] is how many HTTP capabilities are Because the origin [RFC6454] is how many HTTP capabilities are
scoped, applications also need to consider how deployments might scoped, applications also need to consider how deployments might
interact with other applications (including Web browsing) on the same interact with other applications (including Web browsing) on the same
origin. origin.
For example, if Cookies [I-D.ietf-httpbis-rfc6265bis] are used to For example, if Cookies [I-D.ietf-httpbis-rfc6265bis] are used to
carry application state, they will be sent with all requests to the carry application state, they will be sent with all requests to the
origin by default, unless scoped by path, and the application might origin by default, unless scoped by path, and the application might
receive cookies from other applications on the origin. This can lead receive cookies from other applications on the origin. This can lead
skipping to change at page 23, line 28 skipping to change at page 24, line 51
One solution to these issues is to require a dedicated hostname for One solution to these issues is to require a dedicated hostname for
the application, so that it has a unique origin. However, it is the application, so that it has a unique origin. However, it is
often desirable to allow multiple applications to be deployed on a often desirable to allow multiple applications to be deployed on a
single hostname; doing so provides the most deployment flexibility single hostname; doing so provides the most deployment flexibility
and enables them to be "mixed" together (See [RFC7320] for details). and enables them to be "mixed" together (See [RFC7320] for details).
Therefore, applications using HTTP should strive to allow multiple Therefore, applications using HTTP should strive to allow multiple
applications on an origin. applications on an origin.
To enable this, when specifying the use of Cookies, HTTP To enable this, when specifying the use of Cookies, HTTP
authentication realms [I-D.ietf-httpbis-semantics], or other origin- authentication realms [I-D.ietf-httpbis-semantics], or other origin-
wide HTTP mechanisms, applications using HTTP SHOULD NOT mandate the wide HTTP mechanisms, applications using HTTP should not mandate the
use of a particular name, but instead let deployments configure them. use of a particular name, but instead let deployments configure them.
Consideration SHOULD be given to scoping them to part of the origin,
Consideration should be given to scoping them to part of the origin,
using their specified mechanisms for doing so. using their specified mechanisms for doing so.
Modern Web browsers constrain the ability of content from one origin Modern Web browsers constrain the ability of content from one origin
to access resources from another, to avoid leaking private to access resources from another, to avoid leaking private
information. As a result, applications that wish to expose cross- information. As a result, applications that wish to expose cross-
origin data to browsers will need to implement the CORS protocol; see origin data to browsers will need to implement the CORS protocol; see
[FETCH]. [FETCH].
4.14. Server Push 4.14. Using Server Push
HTTP/2 adds the ability for servers to "push" request/response pairs HTTP/2 adds the ability for servers to "push" request/response pairs
to clients in [RFC7540], Section 8.2. While server push seems like a to clients in [RFC7540], Section 8.2. While server push seems like a
natural fit for many common application semantics (e.g., "fanout" and natural fit for many common application semantics (e.g., "fanout" and
publish/subscribe), a few caveats should be noted: publish/subscribe), a few caveats should be noted:
o Server push is hop-by-hop; that is, it is not automatically o Server push is hop-by-hop; that is, it is not automatically
forwarded by intermediaries. As a result, it might not work forwarded by intermediaries. As a result, it might not work
easily (or at all) with proxies, reverse proxies, and Content easily (or at all) with proxies, reverse proxies, and Content
Delivery Networks. Delivery Networks.
skipping to change at page 24, line 32 skipping to change at page 26, line 5
Applications wishing to optimise cases where the client can perform Applications wishing to optimise cases where the client can perform
work related to requests before the full response is available (e.g., work related to requests before the full response is available (e.g.,
fetching links for things likely to be contained within) might fetching links for things likely to be contained within) might
benefit from using the 103 (Early Hints) status code; see [RFC8297]. benefit from using the 103 (Early Hints) status code; see [RFC8297].
Applications using server push directly need to enforce the Applications using server push directly need to enforce the
requirements regarding authority in [RFC7540], Section 8.2, to avoid requirements regarding authority in [RFC7540], Section 8.2, to avoid
cross-origin push attacks. cross-origin push attacks.
4.15. Versioning and Evolution 4.15. Allowing Versioning and Evolution
It's often necessary to introduce new features into application It's often necessary to introduce new features into application
protocols, and change existing ones. protocols, and change existing ones.
In HTTP, backwards-incompatible changes are possible using a number In HTTP, backwards-incompatible changes are possible using a number
of mechanisms: of mechanisms:
o Using a distinct link relation type [RFC8288] to identify a URL o Using a distinct link relation type [RFC8288] to identify a URL
for a resource that implements the new functionality for a resource that implements the new functionality.
o Using a distinct media type [RFC6838] to identify formats that o Using a distinct media type [RFC6838] to identify formats that
enable the new functionality enable the new functionality.
o Using a distinct HTTP header field to implement new functionality o Using a distinct HTTP header field to implement new functionality
outside the message body outside the message body.
5. IANA Considerations 5. IANA Considerations
This document has no requirements for IANA. This document has no requirements for IANA.
6. Security Considerations 6. Security Considerations
Section 4.10 discusses the impact of using stateful mechanisms in the Section 4.10 discusses the impact of using stateful mechanisms in the
protocol as ambient authority, and suggests a mitigation. protocol as ambient authority, and suggests a mitigation.
skipping to change at page 25, line 28 skipping to change at page 26, line 45
Section 4.12 highlights the implications of Web browsers' Section 4.12 highlights the implications of Web browsers'
capabilities on applications that use HTTP. capabilities on applications that use HTTP.
Section 4.13 discusses the issues that arise when applications are Section 4.13 discusses the issues that arise when applications are
deployed on the same origin as Web sites (and other applications). deployed on the same origin as Web sites (and other applications).
Section 4.14 highlights risks of using HTTP/2 server push in a manner Section 4.14 highlights risks of using HTTP/2 server push in a manner
other than specified. other than specified.
Applications that use HTTP in a manner that involves modification of Applications that use HTTP in a manner that involves modification of
implementations - for example, requiring support for a new URL implementations - for example, requiring support for a new URI
scheme, or a non-standard method - risk having those implementations scheme, or a non-standard method - risk having those implementations
"fork" from their parent HTTP implementations, with the possible "fork" from their parent HTTP implementations, with the possible
result that they do not benefit from patches and other security result that they do not benefit from patches and other security
improvements incorporated upstream. improvements incorporated upstream.
6.1. Privacy Considerations 6.1. Privacy Considerations
HTTP clients can expose a variety of information to servers. Besides HTTP clients can expose a variety of information to servers. Besides
information that's explicitly sent as part of an application's information that's explicitly sent as part of an application's
operation (for example, names and other user-entered data), and "on operation (for example, names and other user-entered data), and "on
skipping to change at page 26, line 21 skipping to change at page 27, line 41
control over its data. As a result, applications are advised to control over its data. As a result, applications are advised to
specify that clients should only emit the information they need to specify that clients should only emit the information they need to
function in requests. function in requests.
Finally, if an application exposes the ability to run mobile code, Finally, if an application exposes the ability to run mobile code,
great care needs to be taken, since any ability to observe its great care needs to be taken, since any ability to observe its
environment can be used as an opportunity to both fingerprint the environment can be used as an opportunity to both fingerprint the
client and to obtain and manipulate private data (including session client and to obtain and manipulate private data (including session
information). For example, access to high-resolution timers (even information). For example, access to high-resolution timers (even
indirectly) can be used to profile the underlying hardware, creating indirectly) can be used to profile the underlying hardware, creating
a unique identifier for the system. Applications are advised avoid a unique identifier for the system. Applications are advised to
allowing the use of mobile code where possible; when it cannot be avoid allowing the use of mobile code where possible; when it cannot
avoided, the resulting system's security properties need be carefully be avoided, the resulting system's security properties need be
scrutinised. carefully scrutinised.
7. References 7. References
7.1. Normative References 7.1. Normative References
[I-D.ietf-httpbis-cache] [I-D.ietf-httpbis-cache]
Fielding, R., Nottingham, M., and J. Reschke, "HTTP Fielding, R., Nottingham, M., and J. Reschke, "HTTP
Caching", draft-ietf-httpbis-cache-03 (work in progress), Caching", draft-ietf-httpbis-cache-05 (work in progress),
October 2018. July 2019.
[I-D.ietf-httpbis-messaging] [I-D.ietf-httpbis-messaging]
Fielding, R., Nottingham, M., and J. Reschke, "HTTP/1.1 Fielding, R., Nottingham, M., and J. Reschke, "HTTP/1.1
Messaging", draft-ietf-httpbis-messaging-03 (work in Messaging", draft-ietf-httpbis-messaging-05 (work in
progress), October 2018. progress), July 2019.
[I-D.ietf-httpbis-semantics] [I-D.ietf-httpbis-semantics]
Fielding, R., Nottingham, M., and J. Reschke, "HTTP Fielding, R., Nottingham, M., and J. Reschke, "HTTP
Semantics", draft-ietf-httpbis-semantics-03 (work in Semantics", draft-ietf-httpbis-semantics-05 (work in
progress), October 2018. progress), July 2019.
[I-D.nottingham-rfc5785bis]
Nottingham, M., "Well-Known Uniform Resource Identifiers
(URIs)", draft-nottingham-rfc5785bis-11 (work in
progress), April 2019.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818,
DOI 10.17487/RFC2818, May 2000, DOI 10.17487/RFC2818, May 2000,
<https://www.rfc-editor.org/info/rfc2818>. <https://www.rfc-editor.org/info/rfc2818>.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66,
RFC 3986, DOI 10.17487/RFC3986, January 2005,
<https://www.rfc-editor.org/info/rfc3986>.
[RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454,
DOI 10.17487/RFC6454, December 2011, DOI 10.17487/RFC6454, December 2011,
<https://www.rfc-editor.org/info/rfc6454>. <https://www.rfc-editor.org/info/rfc6454>.
[RFC6648] Saint-Andre, P., Crocker, D., and M. Nottingham, [RFC6648] Saint-Andre, P., Crocker, D., and M. Nottingham,
"Deprecating the "X-" Prefix and Similar Constructs in "Deprecating the "X-" Prefix and Similar Constructs in
Application Protocols", BCP 178, RFC 6648, Application Protocols", BCP 178, RFC 6648,
DOI 10.17487/RFC6648, June 2012, DOI 10.17487/RFC6648, June 2012,
<https://www.rfc-editor.org/info/rfc6648>. <https://www.rfc-editor.org/info/rfc6648>.
skipping to change at page 27, line 51 skipping to change at page 29, line 36
7.2. Informative References 7.2. Informative References
[CSP] West, M., "Content Security Policy Level 3", World Wide [CSP] West, M., "Content Security Policy Level 3", World Wide
Web Consortium WD WD-CSP3-20160913, September 2016, Web Consortium WD WD-CSP3-20160913, September 2016,
<https://www.w3.org/TR/2016/WD-CSP3-20160913>. <https://www.w3.org/TR/2016/WD-CSP3-20160913>.
[FETCH] WHATWG, "Fetch - Living Standard", n.d., [FETCH] WHATWG, "Fetch - Living Standard", n.d.,
<https://fetch.spec.whatwg.org>. <https://fetch.spec.whatwg.org>.
[HTML5] WHATWG, "HTML - Living Standard", n.d., [HTML] WHATWG, "HTML - Living Standard", n.d.,
<https://html.spec.whatwg.org>. <https://html.spec.whatwg.org>.
[I-D.ietf-httpbis-header-structure] [I-D.ietf-httpbis-header-structure]
Nottingham, M. and P. Kamp, "Structured Headers for HTTP", Nottingham, M. and P. Kamp, "Structured Headers for HTTP",
draft-ietf-httpbis-header-structure-08 (work in progress), draft-ietf-httpbis-header-structure-13 (work in progress),
October 2018. August 2019.
[I-D.ietf-httpbis-rfc6265bis] [I-D.ietf-httpbis-rfc6265bis]
Barth, A. and M. West, "Cookies: HTTP State Management Barth, A. and M. West, "Cookies: HTTP State Management
Mechanism", draft-ietf-httpbis-rfc6265bis-02 (work in Mechanism", draft-ietf-httpbis-rfc6265bis-03 (work in
progress), August 2017. progress), April 2019.
[I-D.nottingham-rfc5785bis]
Nottingham, M., "Well-Known Uniform Resource Identifiers
(URIs)", draft-nottingham-rfc5785bis-08 (work in
progress), October 2018.
[REFERRER-POLICY] [REFERRER-POLICY]
Eisinger, J. and E. Stark, "Referrer Policy", World Wide Eisinger, J. and E. Stark, "Referrer Policy", World Wide
Web Consortium CR CR-referrer-policy-20170126, January Web Consortium CR CR-referrer-policy-20170126, January
2017, 2017,
<https://www.w3.org/TR/2017/CR-referrer-policy-20170126>. <https://www.w3.org/TR/2017/CR-referrer-policy-20170126>.
[RFC3205] Moore, K., "On the use of HTTP as a Substrate", BCP 56, [RFC3205] Moore, K., "On the use of HTTP as a Substrate", BCP 56,
RFC 3205, DOI 10.17487/RFC3205, February 2002, RFC 3205, DOI 10.17487/RFC3205, February 2002,
<https://www.rfc-editor.org/info/rfc3205>. <https://www.rfc-editor.org/info/rfc3205>.
[RFC4367] Rosenberg, J., Ed. and IAB, "What's in a Name: False
Assumptions about DNS Names", RFC 4367,
DOI 10.17487/RFC4367, February 2006,
<https://www.rfc-editor.org/info/rfc4367>.
[RFC4791] Daboo, C., Desruisseaux, B., and L. Dusseault, [RFC4791] Daboo, C., Desruisseaux, B., and L. Dusseault,
"Calendaring Extensions to WebDAV (CalDAV)", RFC 4791, "Calendaring Extensions to WebDAV (CalDAV)", RFC 4791,
DOI 10.17487/RFC4791, March 2007, DOI 10.17487/RFC4791, March 2007,
<https://www.rfc-editor.org/info/rfc4791>. <https://www.rfc-editor.org/info/rfc4791>.
[RFC4918] Dusseault, L., Ed., "HTTP Extensions for Web Distributed [RFC4918] Dusseault, L., Ed., "HTTP Extensions for Web Distributed
Authoring and Versioning (WebDAV)", RFC 4918, Authoring and Versioning (WebDAV)", RFC 4918,
DOI 10.17487/RFC4918, June 2007, DOI 10.17487/RFC4918, June 2007,
<https://www.rfc-editor.org/info/rfc4918>. <https://www.rfc-editor.org/info/rfc4918>.
skipping to change at page 29, line 9 skipping to change at page 30, line 38
<https://www.rfc-editor.org/info/rfc5246>. <https://www.rfc-editor.org/info/rfc5246>.
[RFC5861] Nottingham, M., "HTTP Cache-Control Extensions for Stale [RFC5861] Nottingham, M., "HTTP Cache-Control Extensions for Stale
Content", RFC 5861, DOI 10.17487/RFC5861, May 2010, Content", RFC 5861, DOI 10.17487/RFC5861, May 2010,
<https://www.rfc-editor.org/info/rfc5861>. <https://www.rfc-editor.org/info/rfc5861>.
[RFC6415] Hammer-Lahav, E., Ed. and B. Cook, "Web Host Metadata", [RFC6415] Hammer-Lahav, E., Ed. and B. Cook, "Web Host Metadata",
RFC 6415, DOI 10.17487/RFC6415, October 2011, RFC 6415, DOI 10.17487/RFC6415, October 2011,
<https://www.rfc-editor.org/info/rfc6415>. <https://www.rfc-editor.org/info/rfc6415>.
[RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M.,
and D. Orchard, "URI Template", RFC 6570,
DOI 10.17487/RFC6570, March 2012,
<https://www.rfc-editor.org/info/rfc6570>.
[RFC6797] Hodges, J., Jackson, C., and A. Barth, "HTTP Strict [RFC6797] Hodges, J., Jackson, C., and A. Barth, "HTTP Strict
Transport Security (HSTS)", RFC 6797, Transport Security (HSTS)", RFC 6797,
DOI 10.17487/RFC6797, November 2012, DOI 10.17487/RFC6797, November 2012,
<https://www.rfc-editor.org/info/rfc6797>. <https://www.rfc-editor.org/info/rfc6797>.
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object
Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049,
October 2013, <https://www.rfc-editor.org/info/rfc7049>. October 2013, <https://www.rfc-editor.org/info/rfc7049>.
[RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an [RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an
Attack", BCP 188, RFC 7258, DOI 10.17487/RFC7258, May Attack", BCP 188, RFC 7258, DOI 10.17487/RFC7258, May
2014, <https://www.rfc-editor.org/info/rfc7258>. 2014, <https://www.rfc-editor.org/info/rfc7258>.
[RFC7538] Reschke, J., "The Hypertext Transfer Protocol Status Code
308 (Permanent Redirect)", RFC 7538, DOI 10.17487/RFC7538,
April 2015, <https://www.rfc-editor.org/info/rfc7538>.
[RFC7595] Thaler, D., Ed., Hansen, T., and T. Hardie, "Guidelines [RFC7595] Thaler, D., Ed., Hansen, T., and T. Hardie, "Guidelines
and Registration Procedures for URI Schemes", BCP 35, and Registration Procedures for URI Schemes", BCP 35,
RFC 7595, DOI 10.17487/RFC7595, June 2015, RFC 7595, DOI 10.17487/RFC7595, June 2015,
<https://www.rfc-editor.org/info/rfc7595>. <https://www.rfc-editor.org/info/rfc7595>.
[RFC7605] Touch, J., "Recommendations on Using Assigned Transport [RFC7605] Touch, J., "Recommendations on Using Assigned Transport
Port Numbers", BCP 165, RFC 7605, DOI 10.17487/RFC7605, Port Numbers", BCP 165, RFC 7605, DOI 10.17487/RFC7605,
August 2015, <https://www.rfc-editor.org/info/rfc7605>. August 2015, <https://www.rfc-editor.org/info/rfc7605>.
[RFC7616] Shekh-Yusef, R., Ed., Ahrens, D., and S. Bremer, "HTTP [RFC7616] Shekh-Yusef, R., Ed., Ahrens, D., and S. Bremer, "HTTP
 End of changes. 118 change blocks. 
338 lines changed or deleted 403 lines changed or added

This html diff was produced by rfcdiff 1.44jr. The latest version is available from http://tools.ietf.org/tools/rfcdiff/