diff --git a/fetch.bs b/fetch.bs index 58579420d..f4b4996e2 100644 --- a/fetch.bs +++ b/fetch.bs @@ -2162,6 +2162,17 @@ Unless stated otherwise, it is false.
This flag is for exclusive use by HTML's render-blocking mechanism. [[!HTML]] +
A request has an associated boolean is HTTPS upgrade. +Unless stated otherwise, it is false. + +
This is for exclusive use by HTTPS upgrading. + +
A request has an associated +HTTPS upgrade fallback URL, which is null or a URL. +Unless otherwise stated, it is null. + +
This is for exclusive use by HTTPS upgrading. +
A request has an associated @@ -3270,6 +3281,139 @@ through TLS using ALPN. The protocol cannot be spoofed through HTTP requests in +
User agents may optionally upgrade requests with URLs that are not +potentially trustworthy URLs to attempt to fetch them over +potentially trustworthy URLs. If an upgraded request fails with a network error, it is +retried over the original URL. + +
The HTTPS upgrading algorithm consists of upgrade an HTTP request and +HTTPS upgrade fallback algorithms. + + +
To upgrade an HTTP request given a request request: + +
If any of the following are true: + +
request's destination is not "document
";
+
+
request's method is not "GET
";
+
+
request's URL's origin is exempted from + upgrades in an implementation-defined way, +
then return. +
If request's HTTPS upgrade fallback URL is non-null, then set + is HTTPS upgrade to false and HTTPS upgrade fallback URL to + null and return. + +
This is a fallback request that cannot be upgraded again. + +
Otherwise: + +
Set HTTPS upgrade fallback URL to request's + URL. + +
Set is HTTPS upgrade to true. +
To run HTTPS upgrade fallback given a request request and +response response: + +
If request's is HTTPS upgrade is false, then return + response. + +
If response is a network error: + +
This means that the upgrade failed and initiates a fallback load. + +
Let serializedFallbackURL be the request's + HTTPS upgrade fallback URL, serialized and + isomorphic encoded. + +
Let fallbackResponse be a new response whose
+ header list is «
+ (`Location
`, serializedFallbackURL) » and
+ status is 307.
+
+
Return fallbackResponse. +
Return response. + +
This means the upgrade was successful. +
User agents can implement a fast-fallback path by canceling slow fetches on upgraded +requests, in order to quickly initiate a fallback HTTP fetch. +
a.com
serves both
+http://a.com
and https://a.com
. An eligible request to
+http://a.com
will be upgraded to https://a.com
.
+
+
a.com
serves
+http://a.com
but refuses connections on https://a.com
. An eligible
+request to http://a.com
will be upgraded to https://a.com
, but the fetch
+will fail. A fallback request will be initiated to http://a.com
.
+
+
a.com
serves
+http://a.com
but refuses connections on https://a.com
. Upon
+first request and fallback to http://a.com
, the user agent stores the hostname
+in an allowlist with an expiration time of 7 days. In a future request, if a.com
+is still in this allowlist, the user agent will not upgrade http://a.com
to
+https://a.com
. The user agent will also set the new expiration time of the
+allowlist entry for a.com
to 7 days from now.
+
+
a.com
serves
+http://a.com:8080
. When a site is served from a non-default HTTP port, it's unlikely
+that the corresponding HTTPS URL is served from the default port either. Therefore, the user agent
+doesn't upgrade requests to http://a.com:8080.
+
+
a.com
serves
+http://a.com
and https://a.com
. The latter redirects to the former.
+An eligible request to http://a.com
will be upgraded to
+https://a.com
and will be redirected back to http://a.com
.
+The user agent will detect this as a redirect loop, treat it as a failed upgrade and initiate a
+fallback navigation to http://a.com
.
+
+
Optionally, run upgrade an HTTP request algorithm on request. +
If recursive is false, then run the remaining steps in parallel.
If connection is failure, then return a network error. +
If connection is failure, then return the result of running + HTTPS upgrade fallback given request and a network error.
Set timingInfo's final connection timing info to
the result of calling clamp and coarsen connection timing info with
@@ -8727,7 +8874,7 @@ resource — for non-CORS requests as well as CORS
requests — and do not use `Vary
`.
-
As part of establishing a connection, the {{WebSocket}} object initiates a special kind of
fetch (using a request whose mode is
@@ -8991,6 +9138,7 @@ done only by navigations). The fetch controller is also used to
redirect mode set to "manual
".
+
Thanks to