Skip to content

Commit 1792564

Browse files
committed
Ship Sec-Fetch-Dest.
Based on conversations in [1] and [2], `Sec-Fetch-Dest` seems valuable enough to ship and support. This patch drops the issue asking that question, and closes #16. [1]: #16 [2]: whatwg/fetch#948
1 parent e06ac9f commit 1792564

File tree

2 files changed

+15
-25
lines changed

2 files changed

+15
-25
lines changed

index.bs

+3-7
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ exposes an interesting [=request=] attribute to a server.
113113
The `Sec-Fetch-Dest` HTTP Request Header {#sec-fetch-dest-header}
114114
-----------------------------------------------------------------
115115

116-
ISSUE(mikewest/sec-metadata#16): There are some concerns about the value this header would
117-
provide, particularly in the face of a Service Worker's ability to use cached responses in
118-
unexpected ways. It might be worth punting it to a future iteration.
119-
120116
The <dfn http-header export>`Sec-Fetch-Dest`</dfn> HTTP request header exposes a [=request=]'s
121117
[=request/destination=] to a server. It is a [=Structured Header=] whose value MUST be a
122118
[=structured header/token=]. [[!I-D.ietf-httpbis-header-structure]] Its ABNF is:
@@ -155,7 +151,7 @@ To <dfn abstract-op lt="set-dest">set the `Sec-Fetch-Dest` header</dfn> for a [=
155151

156152
<ol class="algorithm">
157153
1. Assert: |r|'s [=request/url=] is a [=potentially trustworthy URL=].
158-
154+
159155
2. Let |header| be a [=Structured Header=] whose value is a [=structured header/token=].
160156

161157
3. If |r|'s [=request/destination=] is the empty string, set |header|'s value to the string
@@ -190,7 +186,7 @@ To <dfn abstract-op lt="set-mode">set the `Sec-Fetch-Mode` header</dfn> for a [=
190186

191187
<ol class="algorithm">
192188
1. Assert: |r|'s [=request/url=] is a [=potentially trustworthy URL=].
193-
189+
194190
2. Let |header| be a [=Structured Header=] whose value is a [=structured header/token=].
195191

196192
3. Set |header|'s value to |r|'s [=request/mode=].
@@ -228,7 +224,7 @@ To <dfn abstract-op lt="set-site">set the `Sec-Fetch-Site` header</dfn> for a [=
228224

229225
<ol class="algorithm">
230226
1. Assert: |r|'s [=request/url=] is a [=potentially trustworthy URL=].
231-
227+
232228
2. Let |header| be a [=Structured Header=] whose value is a [=structured header/token=].
233229

234230
3. Set |header|'s value to `same-origin`.

index.html

+12-18
Original file line numberDiff line numberDiff line change
@@ -1212,9 +1212,9 @@
12121212
}
12131213
}
12141214
</style>
1215-
<meta content="Bikeshed version b76a1f3caa65320a39ee72dbf2680ea887ace619" name="generator">
1215+
<meta content="Bikeshed version 08c4b0e94d147852f66673459784d3429bb3bda1" name="generator">
12161216
<link href="https://w3.org/TR/fetch-metadata/" rel="canonical">
1217-
<meta content="04cbc361af4df1dae7d2e144f5ae82f1c44d7cb8" name="document-revision">
1217+
<meta content="e06ac9fc9a72097c7486f43426bcf03e95d26f45" name="document-revision">
12181218
<style>/* style-md-lists */
12191219

12201220
/* This is a weird hack for me not yet following the commonmark spec
@@ -1414,7 +1414,7 @@
14141414
<div class="head">
14151415
<p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
14161416
<h1 class="p-name no-ref" id="title">Fetch Metadata Request Headers</h1>
1417-
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2019-10-04">4 October 2019</time></span></h2>
1417+
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2019-11-25">25 November 2019</time></span></h2>
14181418
<div data-fill-with="spec-metadata">
14191419
<dl>
14201420
<dt>This version:
@@ -1426,7 +1426,7 @@ <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="cont
14261426
<dt>Feedback:
14271427
<dd><span><a href="mailto:[email protected]?subject=%5Bfetch-metadata%5D%20YOUR%20TOPIC%20HERE">[email protected]</a> with subject line “<kbd>[fetch-metadata] <i data-lt>… message topic …</i></kbd>” (<a href="https://lists.w3.org/Archives/Public/public-webappsec/" rel="discussion">archives</a>)</span>
14281428
<dt>Issue Tracking:
1429-
<dd><a href="https://github.com/w3c/webappsec-fetch-metadata/issues/">GitHub</a>
1429+
<dd><a href="https://github.com/mikewest/sec-metadata/issues/">GitHub</a>
14301430
<dd><a href="#issues-index">Inline In Spec</a>
14311431
<dt class="editor">Editor:
14321432
<dd class="editor p-author h-card vcard" data-editor-id="56384"><a class="p-name fn u-email email" href="mailto:[email protected]">Mike West</a> (<span class="p-org org">Google Inc.</span>)
@@ -1570,9 +1570,6 @@ <h2 class="heading settled" data-level="2" id="framework"><span class="secno">2.
15701570
<p>The following sections define several <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="fetch-metadata-headers">fetch metadata headers</dfn>, each of which
15711571
exposes an interesting <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request" id="ref-for-concept-request">request</a> attribute to a server.</p>
15721572
<h3 class="heading settled" data-level="2.1" id="sec-fetch-dest-header"><span class="secno">2.1. </span><span class="content">The <code>Sec-Fetch-Dest</code> HTTP Request Header</span><a class="self-link" href="#sec-fetch-dest-header"></a></h3>
1573-
<p class="issue" id="issue-d1aaf268"><a class="self-link" href="#issue-d1aaf268"></a> There are some concerns about the value this header would
1574-
provide, particularly in the face of a Service Worker’s ability to use cached responses in
1575-
unexpected ways. It might be worth punting it to a future iteration. <a href="https://github.com/mikewest/sec-metadata/issues/16">&lt;https://github.com/mikewest/sec-metadata/issues/16></a></p>
15761573
<p>The <dfn class="dfn-paneled" data-dfn-type="http-header" data-export id="http-headerdef-sec-fetch-dest"><code>Sec-Fetch-Dest</code></dfn> HTTP request header exposes a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request" id="ref-for-concept-request①">request</a>'s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-destination" id="ref-for-concept-request-destination">destination</a> to a server. It is a <a data-link-type="dfn" href="https://tools.ietf.org/html/draft-ietf-httpbis-header-structure#" id="termref-for-">Structured Header</a> whose value MUST be a <a data-link-type="dfn" href="https://tools.ietf.org/html/draft-ietf-httpbis-header-structure#section-3.7" id="ref-for-section-3.7">token</a>. <a data-link-type="biblio" href="#biblio-i-dietf-httpbis-header-structure">[I-D.ietf-httpbis-header-structure]</a> Its ABNF is:</p>
15771574
<pre>Sec-Fetch-Dest = sh-token
15781575
</pre>
@@ -1672,7 +1669,7 @@ <h3 class="heading settled" data-level="2.3" id="sec-fetch-site-header"><span cl
16721669
<li data-md>
16731670
<p><var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-origin" id="ref-for-concept-request-origin②">origin</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-scheme" id="ref-for-concept-origin-scheme">scheme</a> is not the same as <var>url</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme">scheme</a></p>
16741671
<li data-md>
1675-
<p><var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-origin" id="ref-for-concept-request-origin③">origin</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-host" id="ref-for-concept-origin-host">host</a> is not <a data-link-type="dfn" href="https://url.spec.whatwg.org/#host-same-site" id="ref-for-host-same-site">same site</a> with <var>url</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-host" id="ref-for-concept-url-host">host</a></p>
1672+
<p><var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-origin" id="ref-for-concept-request-origin③">origin</a>'s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-host" id="ref-for-concept-origin-host">host</a> is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-site" id="ref-for-same-site">same site</a> with <var>url</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-host" id="ref-for-concept-url-host">host</a></p>
16761673
</ul>
16771674
<li data-md>
16781675
<p>Set <var>header</var>’s value to <code>same-site</code>.</p>
@@ -2089,6 +2086,12 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
20892086
<li><a href="#ref-for-same-origin">2.3. The Sec-Fetch-Site HTTP Request Header</a>
20902087
</ul>
20912088
</aside>
2089+
<aside class="dfn-panel" data-for="term-for-same-site">
2090+
<a href="https://html.spec.whatwg.org/multipage/origin.html#same-site">https://html.spec.whatwg.org/multipage/origin.html#same-site</a><b>Referenced in:</b>
2091+
<ul>
2092+
<li><a href="#ref-for-same-site">2.3. The Sec-Fetch-Site HTTP Request Header</a>
2093+
</ul>
2094+
</aside>
20922095
<aside class="dfn-panel" data-for="term-for-concept-origin-scheme">
20932096
<a href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-scheme">https://html.spec.whatwg.org/multipage/origin.html#concept-origin-scheme</a><b>Referenced in:</b>
20942097
<ul>
@@ -2154,12 +2157,6 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
21542157
<li><a href="#ref-for-concept-url-host">2.3. The Sec-Fetch-Site HTTP Request Header</a>
21552158
</ul>
21562159
</aside>
2157-
<aside class="dfn-panel" data-for="term-for-host-same-site">
2158-
<a href="https://url.spec.whatwg.org/#host-same-site">https://url.spec.whatwg.org/#host-same-site</a><b>Referenced in:</b>
2159-
<ul>
2160-
<li><a href="#ref-for-host-same-site">2.3. The Sec-Fetch-Site HTTP Request Header</a>
2161-
</ul>
2162-
</aside>
21632160
<aside class="dfn-panel" data-for="term-for-concept-url-scheme">
21642161
<a href="https://url.spec.whatwg.org/#concept-url-scheme">https://url.spec.whatwg.org/#concept-url-scheme</a><b>Referenced in:</b>
21652162
<ul>
@@ -2196,6 +2193,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
21962193
<li><span class="dfn-paneled" id="term-for-the-picture-element" style="color:initial">picture</span>
21972194
<li><span class="dfn-paneled" id="term-for-process-a-navigate-fetch" style="color:initial">process a navigate fetch</span>
21982195
<li><span class="dfn-paneled" id="term-for-same-origin" style="color:initial">same origin</span>
2196+
<li><span class="dfn-paneled" id="term-for-same-site" style="color:initial">same site</span>
21992197
<li><span class="dfn-paneled" id="term-for-concept-origin-scheme" style="color:initial">scheme</span>
22002198
<li><span class="dfn-paneled" id="term-for-concept-environment-target-browsing-context" style="color:initial">target browsing context</span>
22012199
<li><span class="dfn-paneled" id="term-for-triggered-by-user-activation" style="color:initial">triggered by user activation</span>
@@ -2221,7 +2219,6 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
22212219
<a data-link-type="biblio">[URL]</a> defines the following terms:
22222220
<ul>
22232221
<li><span class="dfn-paneled" id="term-for-concept-url-host" style="color:initial">host</span>
2224-
<li><span class="dfn-paneled" id="term-for-host-same-site" style="color:initial">same site</span>
22252222
<li><span class="dfn-paneled" id="term-for-concept-url-scheme" style="color:initial">scheme</span>
22262223
</ul>
22272224
</ul>
@@ -2254,9 +2251,6 @@ <h3 class="no-num no-ref heading settled" id="informative"><span class="content"
22542251
</dl>
22552252
<h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
22562253
<div style="counter-reset:issue">
2257-
<div class="issue"> There are some concerns about the value this header would
2258-
provide, particularly in the face of a Service Worker’s ability to use cached responses in
2259-
unexpected ways. It might be worth punting it to a future iteration. <a href="https://github.com/mikewest/sec-metadata/issues/16">&lt;https://github.com/mikewest/sec-metadata/issues/16></a><a href="#issue-d1aaf268"></a></div>
22602254
<div class="issue"> This flag is defined here, in <a href="#fetch-integration">§ 3 Integration with Fetch and HTML</a>. Ideally,
22612255
we can move it to Fetch rather than monkey-patching. <a href="https://github.com/whatwg/fetch/issues/885">&lt;https://github.com/whatwg/fetch/issues/885></a><a href="#issue-43037b44"></a></div>
22622256
<div class="issue"> Monkey patching! <a href="https://github.com/whatwg/fetch/issues/885">&lt;https://github.com/whatwg/fetch/issues/885></a><a href="#issue-8b31d2cf"></a></div>

0 commit comments

Comments
 (0)