Re: [whatwg/fetch] Stop censoring fragments (#696)

annevk commented on this pull request.



> @@ -3402,6 +3395,13 @@ optional <i>CORS flag</i> and <i>CORS-preflight flag</i>, run these steps:
       </ul>
 
       <p>then return a <a>network error</a>.
+
+     <li>
+      <p>If <var>actualResponse</var>'s <a for=response>URL</a>'s <a for=url>fragment</a> is null,
+      then set <var>actualResponse</var>'s <a for=response>URL</a>'s <a for=url>fragment</a> to
+      <var>request</var>'s <a for=request>current URL</a>'s <a for=url>fragment</a>.
+
+      <p class=note>Without this step, the fragment would end up getting lost due to the Cache API.

In particular, a scenario @wanderview pointed out that I'm worried about is that `demo.svg` gets stored in the Cache API. A request for `demo.svg#viewBox...` comes in, `demo.svg` gets returned and the fragment identifier is lost.

This does suggest you have to be quite careful with how you store things in the cache if we keep the fragment around, or perhaps the Cache API should always drop the fragment beforehand?

@jakearchibald @jungkees @wanderview it'd be good to resolve that question and create a PR for the outcome against service workers.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/696#pullrequestreview-150157620

Received on Tuesday, 28 August 2018 14:43:20 UTC