Skip to content

Commit 377824d

Browse files
committed
Add custom port and redirect examples, move the upgrade step
1 parent 60a6b1a commit 377824d

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

fetch.bs

+25-10
Original file line numberDiff line numberDiff line change
@@ -3307,7 +3307,10 @@ retried over the original URL.
33073307
<li><p><var>request</var>'s <a for="request">method</a> is not "<code>GET</code>";
33083308

33093309
<li><p><var>request</var>'s <a for="request">URL</a>'s <a for="url">scheme</a> is not
3310-
"<code>http</code>"; or
3310+
"<code>http</code>";
3311+
3312+
<li><p><var>request</var>'s <a for="request">URL</a>'s <a for="url">port</a> is not the default
3313+
port; or
33113314

33123315
<li><p><var>request</var>'s <a for="request">URL</a>'s <a for="url">origin</a> is exempted from
33133316
upgrades in an <a>implementation-defined</a> way,
@@ -3390,13 +3393,25 @@ requests, in order to quickly initiate a fallback HTTP fetch.
33903393
request to <code>http://a.com</code> will be upgraded to <code>https://a.com</code>, but the fetch
33913394
will fail. A fallback request will be initiated to <code>http://a.com</code>.
33923395

3393-
<p id=example-https-upgrade-allowlist class=example><code>site.test</code> serves
3394-
<code>http://site.test</code> but refuses connections on <code>https://site.test</code>. Upon
3395-
first request and fallback to <code>http://site.test</code>, the user agent stores the hostname
3396-
in an allowlist with an expiration time of 7 days. In a future request, if <code>site.test</code>
3397-
is still in this allowlist, the user agent will not upgrade <code>http://site.test</code> to
3398-
<code>https://site.test</code>. The user agent will also set the new expiration time of the
3399-
allowlist entry for <code>site.test</code> to 7 days from now.
3396+
<p id=example-https-upgrade-allowlist class=example><code>a.com</code> serves
3397+
<code>http://a.com</code> but refuses connections on <code>https://a.com</code>. Upon
3398+
first request and fallback to <code>http://a.com</code>, the user agent stores the hostname
3399+
in an allowlist with an expiration time of 7 days. In a future request, if <code>a.com</code>
3400+
is still in this allowlist, the user agent will not upgrade <code>http://a.com</code> to
3401+
<code>https://a.com</code>. The user agent will also set the new expiration time of the
3402+
allowlist entry for <code>a.com</code> to 7 days from now.
3403+
3404+
<p id=example-https-upgrade-ports class=example><code>a.com</code> serves
3405+
<code>http://a.com:8080</code>. When a site is served from a non-default HTTP port, it's unlikely
3406+
that the corresponding HTTPS URL is served from the default port either. Therefore, the user agent
3407+
doesn't upgrade requests to <code>http://a.com:8080.</code>
3408+
3409+
<p id=example-https-upgrade-redirect-loop class=example><code>a.com</code> serves
3410+
<code>http://a.com</code> and <code>https://a.com</code>. The latter redirects to the former.
3411+
An eligible request to <code>http://a.com</code> will be upgraded to
3412+
<code>https://a.com</code> and will be redirected back to <code>http://a.com</code>.
3413+
The user agent will detect this as a redirect loop, treat it as a failed upgrade and initiate a
3414+
fallback navigation to <code>http://a.com</code>.
34003415

34013416

34023417

@@ -4586,8 +4601,6 @@ steps:
45864601

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

4589-
<li><p>Optionally, run <a>upgrade an HTTP request</a> algorithm on <var>request</var>.
4590-
45914604
<li><p><a>Upgrade a mixed content <var>request</var> to a potentially trustworthy URL, if appropriate</a>.
45924605

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

4651+
<li><p>Optionally, run <a>upgrade an HTTP request</a> algorithm on <var>request</var>.
4652+
46384653
<li><p>If <var>recursive</var> is false, then run the remaining steps <a>in parallel</a>.
46394654

46404655
<li>

0 commit comments

Comments
 (0)