Skip to content

Commit 96b4288

Browse files
committed
Add custom port and redirect examples, move the upgrade step
1 parent 13524e9 commit 96b4288

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

fetch.bs

+21-9
Original file line numberDiff line numberDiff line change
@@ -3410,13 +3410,25 @@ requests, in order to quickly initiate a fallback HTTP fetch.
34103410
request to <code>http://a.com</code> will be upgraded to <code>https://a.com</code>, but the fetch
34113411
will fail. A fallback request will be initiated to <code>http://a.com</code>.
34123412

3413-
<p id=example-https-upgrade-allowlist class=example><code>site.test</code> serves
3414-
<code>http://site.test</code> but refuses connections on <code>https://site.test</code>. Upon
3415-
first request and fallback to <code>http://site.test</code>, the user agent stores the hostname
3416-
in an allowlist with an expiration time of 7 days. In a future request, if <code>site.test</code>
3417-
is still in this allowlist, the user agent will not upgrade <code>http://site.test</code> to
3418-
<code>https://site.test</code>. The user agent will also set the new expiration time of the
3419-
allowlist entry for <code>site.test</code> to 7 days from now.
3413+
<p id=example-https-upgrade-allowlist class=example><code>a.com</code> serves
3414+
<code>http://a.com</code> but refuses connections on <code>https://a.com</code>. Upon
3415+
first request and fallback to <code>http://a.com</code>, the user agent stores the hostname
3416+
in an allowlist with an expiration time of 7 days. In a future request, if <code>a.com</code>
3417+
is still in this allowlist, the user agent will not upgrade <code>http://a.com</code> to
3418+
<code>https://a.com</code>. The user agent will also set the new expiration time of the
3419+
allowlist entry for <code>a.com</code> to 7 days from now.
3420+
3421+
<p id=example-https-upgrade-ports class=example><code>a.com</code> serves
3422+
<code>http://a.com:8080</code>. When a site is served from a non-default HTTP port, it's unlikely
3423+
that the corresponding HTTPS URL is served from the default port either. Therefore, the user agent
3424+
doesn't upgrade requests to <code>http://a.com:8080.</code>
3425+
3426+
<p id=example-https-upgrade-redirect-loop class=example><code>a.com</code> serves
3427+
<code>http://a.com</code> and <code>https://a.com</code>. The latter redirects to the former.
3428+
An eligible request to <code>http://a.com</code> will be upgraded to
3429+
<code>https://a.com</code> and will be redirected back to <code>http://a.com</code>.
3430+
The user agent will detect this as a redirect loop, treat it as a failed upgrade and initiate a
3431+
fallback navigation to <code>http://a.com</code>.
34203432

34213433

34223434

@@ -4609,8 +4621,6 @@ steps:
46094621

46104622
<li><p><a>Upgrade <var>request</var> to a potentially trustworthy URL, if appropriate</a>.
46114623

4612-
<li><p>Optionally, run <a>upgrade an HTTP request</a> algorithm on <var>request</var>.
4613-
46144624
<li><p><a>Upgrade a mixed content <var>request</var> to a potentially trustworthy URL, if appropriate</a>.
46154625

46164626
<li><p>If <a lt="block bad port">should <var>request</var> be blocked due to a bad port</a>,
@@ -4660,6 +4670,8 @@ steps:
46604670
in the fetch algorithm and potentially unwind logic on discovering the need to change
46614671
<var>request</var>'s <a for=request>current URL</a>'s <a for=url>scheme</a>.
46624672

4673+
<li><p>Optionally, run <a>upgrade an HTTP request</a> algorithm on <var>request</var>.
4674+
46634675
<li><p>If <var>recursive</var> is false, then run the remaining steps <a>in parallel</a>.
46644676

46654677
<li>

0 commit comments

Comments
 (0)