Skip to content

Commit 4d2bbe5

Browse files
committed
UPGRADE: Clarify examples.
Fixes #226.
1 parent ed2d7d1 commit 4d2bbe5

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

specs/upgrade/index.html

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<h1 class="p-name no-ref" id="title">Upgrade Insecure Requests</h1>
7272

7373
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft,
74-
<time class="dt-updated" datetime="2015-07-14">14 July 2015</time></span></h2>
74+
<time class="dt-updated" datetime="2015-07-15">15 July 2015</time></span></h2>
7575

7676
<div data-fill-with="spec-metadata">
7777
<dl>
@@ -168,6 +168,11 @@ <h2 class="no-num no-toc no-ref heading settled" id="contents"><span class="cont
168168
<ul class="toc">
169169
<li><a href="#goals"><span class="secno">1.1</span> <span class="content">Goals</span></a>
170170
<li><a href="#examples"><span class="secno">1.2</span> <span class="content">Examples</span></a>
171+
<ul class="toc">
172+
<li><a href="#example-subresource"><span class="secno">1.2.1</span> <span class="content">Subresource Upgrades</span></a>
173+
<li><a href="#example-navigation"><span class="secno">1.2.2</span> <span class="content">Navigational Upgrades</span></a>
174+
<li><a href="#example-failed"><span class="secno">1.2.3</span> <span class="content">Failed Upgrade</span></a>
175+
</ul>
171176
<li><a href="#recommendations"><span class="secno">1.3</span> <span class="content">Recommendations</span></a>
172177
</ul>
173178
<li><a href="#key-concepts"><span class="secno">2</span> <span class="content">Key Concepts and Terminology</span></a>
@@ -350,6 +355,9 @@ <h3 class="heading settled" data-level="1.1" id="goals"><span class="secno">1.1.
350355
<h3 class="heading settled" data-level="1.2" id="examples"><span class="secno">1.2. </span><span class="content">Examples</span><a class="self-link" href="#examples"></a></h3>
351356

352357

358+
<h4 class="heading settled" data-level="1.2.1" id="example-subresource"><span class="secno">1.2.1. </span><span class="content">Subresource Upgrades</span><a class="self-link" href="#example-subresource"></a></h4>
359+
360+
353361
<div class="example" id="example-35db2d27"><a class="self-link" href="#example-35db2d27"></a>
354362
Megacorp, Inc. wishes to migrate <code>http://example.com/</code> to
355363
<code>https://example.com</code>. They set up their servers
@@ -405,6 +413,9 @@ <h3 class="heading settled" data-level="1.2" id="examples"><span class="secno">1
405413
</div>
406414

407415

416+
<h4 class="heading settled" data-level="1.2.2" id="example-navigation"><span class="secno">1.2.2. </span><span class="content">Navigational Upgrades</span><a class="self-link" href="#example-navigation"></a></h4>
417+
418+
408419
<div class="example" id="example-1b5868ed"><a class="self-link" href="#example-1b5868ed"></a>
409420
Megacorp, Inc. isn’t quite ready to deliver Strict Transport Security
410421
headers <a data-link-type="biblio" href="#biblio-rfc6797">[RFC6797]</a>, but does want to keep users on secure pages when
@@ -452,6 +463,33 @@ <h3 class="heading settled" data-level="1.2" id="examples"><span class="secno">1
452463
</div>
453464

454465

466+
<h4 class="heading settled" data-level="1.2.3" id="example-failed"><span class="secno">1.2.3. </span><span class="content">Failed Upgrade</span><a class="self-link" href="#example-failed"></a></h4>
467+
468+
469+
<div class="example" id="example-962745f2"><a class="self-link" href="#example-962745f2"></a>
470+
Tinycorp, Inc. enabled <code><a data-link-type="dfn" href="#upgrade_insecure_requests">upgrade-insecure-requests</a></code> a bit
471+
earlier than they should have, as they don’t actually support HTTPS on
472+
<code>http://cdn.example.com/</code>. Given the following code:
473+
474+
475+
<pre>&lt;img src="http://cdn.example.com/image.png">
476+
</pre>
477+
478+
479+
480+
<p>User agents will upgrade requests, as described in <a href="#example-subresource">§1.2.1 Subresource Upgrades</a>,
481+
rewriting the URL as <code>https://cdn.example.com/image.png</code>. As the
482+
server doesn’t respond to secure requests, this results in a network error.</p>
483+
484+
485+
486+
<p>There is no fallback in this scenario: the user agent acts just as though
487+
the request had been intentionally made, and the request fails.</p>
488+
489+
490+
</div>
491+
492+
455493
<h3 class="heading settled" data-level="1.3" id="recommendations"><span class="secno">1.3. </span><span class="content">Recommendations</span><a class="self-link" href="#recommendations"></a></h3>
456494

457495

specs/upgrade/index.src.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ <h3 id="goals">Goals</h3>
243243

244244
<h3 id="examples">Examples</h3>
245245

246+
<h4 id="example-subresource">Subresource Upgrades</h4>
247+
246248
<div class="example">
247249
Megacorp, Inc. wishes to migrate <code>http://example.com/</code> to
248250
<code>https://example.com</code>. They set up their servers
@@ -283,6 +285,8 @@ <h3 id="examples">Examples</h3>
283285
transparently upgraded with no effort on their part.
284286
</div>
285287

288+
<h4 id="example-navigation">Navigational Upgrades</h4>
289+
286290
<div class="example">
287291
Megacorp, Inc. isn't quite ready to deliver Strict Transport Security
288292
headers [[RFC6797]], but does want to keep users on secure pages when
@@ -316,6 +320,25 @@ <h3 id="examples">Examples</h3>
316320
won't be upgraded.
317321
</div>
318322

323+
<h4 id="example-failed">Failed Upgrade</h4>
324+
325+
<div class="example">
326+
Tinycorp, Inc. enabled <code><a>upgrade-insecure-requests</a></code> a bit
327+
earlier than they should have, as they don't actually support HTTPS on
328+
<code>http://cdn.example.com/</code>. Given the following code:
329+
330+
<pre>
331+
&lt;img src="http://cdn.example.com/image.png"&gt;
332+
</pre>
333+
334+
User agents will upgrade requests, as described in [[#example-subresource]],
335+
rewriting the URL as <code>https://cdn.example.com/image.png</code>. As the
336+
server doesn't respond to secure requests, this results in a network error.
337+
338+
There is no fallback in this scenario: the user agent acts just as though
339+
the request had been intentionally made, and the request fails.
340+
</div>
341+
319342
<h3 id="recommendations">Recommendations</h3>
320343

321344
We recommend that authors who wish to ensure that user agents which support

0 commit comments

Comments
 (0)