Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1724,6 +1724,10 @@ is "<code>all</code>" or "<code>none</code>". Unless stated otherwise it is "<co
</dl>
</div>

<p>A <a for=/>request</a> has an associated <dfn for=request export>service-workers race token</dfn> (a string). Unless stated otherwise it is null.

<p class=note>This is only set by <a for=/>handle fetch</a> in service workers.

<p>A <a for=/>request</a> has an associated
<dfn export for=request id=concept-request-initiator>initiator</dfn>, which is
the empty string,
Expand Down Expand Up @@ -4523,6 +4527,22 @@ steps:
<li><p>Return <var>fetchParams</var>'s <a for="fetch params">preloaded response candidate</a>.
</ol>

<dt><var>request</var>'s <a for=request>service-workers race token</a> is not null
<dd>
<ol>
<li><p>Let <var>raceReesponse</var> to the result of [=lookup-race-response=] given <var>request</var>'s <a for=request>service-workers race token</a>, <var>request</var>'s <a for=request>reserved client</a>, <var>request</var>'s <a for=request>URL</a>.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will [=lookup-race-response=] be defined in SW spec?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I guess we only do the matching for HTTP/HTTPS and GET request. Do we do such restriction here?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will [=lookup-race-response=] be defined in SW spec?

Yes. It's added in yoshisatoyanagisawa/ServiceWorker#10. I'm not sure if we have a good way to call an upcoming algorithm.

Also, I guess we only do the matching for HTTP/HTTPS and GET request. Do we do such restriction here?

Those are described in yoshisatoyanagisawa/ServiceWorker#10. The token is set under those restrictions. I guess we don't have to rephrase them.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

<li><p>If <var>raceReesponse</var> is non-null, then:
<ol>
<li><p>Wait until <var>raceReesponse</var> settles.
<li><p>If <var>raceReesponse</var> resolves with <var>response</var>, then:
<ol>
<li><p><a for=/>Assert</a>: <var>response</var> is a <a for=/>response</a>.
<li><p>Return <var>response</var>.
</ol>
<li><p>If <var>raceReesponse</var> rejects, return a <a>network error</a>.
</ol>
</ol>

<dt><var>request</var>'s <a for=request>current URL</a>'s <a for=url>origin</a> is
<a>same origin</a> with <var>request</var>'s <a for=request>origin</a>, and <var>request</var>'s
<a for=request>response tainting</a> is "<code>basic</code>"
Expand Down