The ORIGIN HTTP/2 FrameAkamaimnot@mnot.nethttps://www.mnot.net/Akamainygren@akamai.com
General
HTTPInternet-DraftThis document specifies the ORIGIN frame for HTTP/2, to indicate what origins are available on a
given connection.Discussion of this draft takes place on the HTTP working group mailing list
(ietf-http-wg@w3.org), which is archived at https://lists.w3.org/Archives/Public/ietf-http-wg/.Working Group information can be found at http://httpwg.github.io/; source
code and issues list for this draft can be found at https://github.com/httpwg/http-extensions/labels/origin-frame.HTTP/2 allows clients to coalesce different origins onto the same
connection when certain conditions are met. However, in certain cases, a connection is is not
usable for a coalesced origin, so the 421 (Misdirected Request) status code (, Section
9.1.2) was defined.Using a status code in this manner allows clients to recover from misdirected requests, but at the
penalty of adding latency. To address that, this specification defines a new HTTP/2 frame type,
“ORIGIN”, to allow servers to indicate what origins a connection is usable for.The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
“RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in
.The ORIGIN HTTP/2 frame (, Section 4) allows a server to indicate what origin(s)
the server would like the client to consider as members of the Origin Set ()
for the connection it occurs within.The ORIGIN frame type is 0xb (decimal 11).The ORIGIN frame’s payload contains the following fields, sets of which may be repeated within the
frame to indicate multiple origins:
An unsigned, 16-bit integer indicating the length, in octets, of the Origin field.
An optional sequence of characters containing the ASCII serialization of an origin (, Section 6.2) that the sender believes this connection is or could be authoritative for.The ORIGIN frame defines the following flags:
Indicates that the Origin Set MUST be reset to an empty set before processing the contents of the frame it occurs upon.
Indicates that the origin(s) carried in the payload must be removed from the Origin Set, if present; if not present, it/they have no effect.The set of origins (as per ) that a given connection might be used for is known in this
specification as the Origin Set.When a connection is first established, its Origin Set is defined to be those origins that the client would normally consider the connection authoritative for; see , Section 10.1.The ORIGIN frame allows the server to modify the Origin Set. In particular:A server can add to its members by sending an ORIGIN frame (without any flags set);A server can prune one or more origins from it by sending an ORIGIN frame with the REMOVE flag set;A server can remove all its members and then add zero or more members by sending an ORIGIN frame with the CLEAR flag set and a payload containing the new origins.Adding to the Origin Set (cases 1 and 3 above) does not imply that the connection is authoritative
for the added origins (in the sense of , Section 10.1) on its own; this MUST be
established by some other mechanism.A client that implements this specification MUST NOT use a connection for a given origin unless that origin appears in the Origin Set for the connection, regardless of whether or not it believes that the connection is authoritative for that origin.The ORIGIN frame is a non-critical extension to HTTP/2. Endpoints that do not support this frame
can safely ignore it upon receipt.When received by a client, it can be used to inform HTTP/2 connection coalescing (see ), but
does not relax the requirement there that the server is authoritative.The origin frame MUST be sent on stream 0; an ORIGIN frame on any other stream is invalid and MUST be ignored.The ORIGIN frame is processed hop-by-hop. An intermediary MUST NOT forward ORIGIN frames. Clients
configured to use a proxy MUST ignore any ORIGIN frames received from it.The following algorithm illustrates how a client can handle received ORIGIN frames:If the client is configured to use a proxy, ignore the frame and stop processing.If the frame occurs upon any stream except stream 0, ignore the frame and stop processing.If the CLEAR flag is set, remove all members from the Origin Set.For each Origin field origin_raw in the frame payload:
Parse origin_raw as an ASCII serialization of an origin (, Section 6.2) and let the result be parsed_origin.If the REMOVE flag is set, remove any member of the Origin Set that is the same as parsed_origin (as per , Section 5), and continue to the next parsed_origin.Otherwise, add parsed_origin to the Origin Set.Clients that blindly trust the ORIGIN frame’s contents will be vulnerable to a large number of
attacks; hence the reinforcement that this specification does not relax the requirement for server
authority in , Section 10.1.Key words for use in RFCs to Indicate Requirement LevelsIn many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.Hypertext Transfer Protocol Version 2 (HTTP/2)This specification describes an optimized expression of the semantics of the Hypertext Transfer Protocol (HTTP), referred to as HTTP version 2 (HTTP/2). HTTP/2 enables a more efficient use of network resources and a reduced perception of latency by introducing header field compression and allowing multiple concurrent exchanges on the same connection. It also introduces unsolicited push of representations from servers to clients.This specification is an alternative to, but does not obsolete, the HTTP/1.1 message syntax. HTTP's existing semantics remain unchanged.The Web Origin ConceptThis document defines the concept of an "origin", which is often used as the scope of authority or privilege by user agents. Typically, user agents isolate content retrieved from different origins to prevent malicious web site operators from interfering with the operation of benign web sites. In addition to outlining the principles that underlie the concept of origin, this document details how to determine the origin of a URI and how to serialize an origin into a string. It also defines an HTTP header field, named "Origin", that indicates which origins are associated with an HTTP request. [STANDARDS-TRACK]