Skip to content

Commit e1803cc

Browse files
committed
Send Sec-Purpose: prefetch for prefetch requests
The purpose headers allows servers to discern between regular requests and "resource hints" - requests that are only meant to populate caches. This replaces the existing `Purpose` and `x-moz: prefetch` headers. Closes w3c/webappsec-fetch-metadata#84 Part of whatwg/html#8111
1 parent 4500d3a commit e1803cc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fetch.bs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5313,6 +5313,10 @@ run these steps:
53135313
<li><p><a abstract-op lt="append the Fetch metadata headers for a request">Append the Fetch metadata headers for <var>httpRequest</var></a>.
53145314
[[!FETCH-METADATA]]
53155315

5316+
<li><p>If <var>httpRequest</var>'s <a for=request>initiator</a> is "<code>prefetch</code>", then
5317+
<a for="header list">append</a> (`<code>Sec-Purpose</code>`, "<code>prefetch</code>") to
5318+
<var>httpRequest</var>'s <a for=request>header list</a>.
5319+
53165320
<li><p>If <var>httpRequest</var>'s <a for=request>header list</a>
53175321
<a for="header list">does not contain</a> `<code>User-Agent</code>`, then user agents should
53185322
<a for="header list">append</a> (`<code>User-Agent</code>`,

0 commit comments

Comments
 (0)