Closed Bug 1352914 Opened 7 years ago Closed 7 years ago

ServiceWorker request proxy receiving URL fragment

Categories

(Core :: DOM: Service Workers, defect)

52 Branch
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: hacker, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36

Steps to reproduce:

Open https://balls.com/#test with the following ServiceWorker set:

self.addEventListener('fetch', function (e) {
	console.log(e.request.url);
});


Actual results:

Console log: "https://balls.com/#test"


Expected results:

Console log: "https://balls.com/"

I think this is a regression in Firefox 52 (but not 100% sure on that). I'm not certain from skimming the spec whether this behaviour is allowed or not (the only ctrl+F results for "fragment" in the fetch spec are about the Response object url, and the only results in the ServiceWorker spec are related to caching), but Chrome at least behaves in accordance with my expected results, and I believe Firefox pre-52 did as well. In any case, dropping the fragment seems to me to be the most intuitive way to handle this since it's consistent with how requests are handled in general.
Component: Untriaged → DOM: Service Workers
Product: Firefox → Core
This is a spec change:

https://github.com/w3c/ServiceWorker/issues/854

We implemented it in bug 1264178 which did indeed ship in FF52.

Chrome is just implementing it now:

https://chromium.googlesource.com/chromium/src.git/+/7ea0952f2888c2de0cc0827743e63de9e7dc3778

Based on that I'm going to mark this wontfix for now.  Feel free to re-open if I missed something.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
I also requested that MDN get updated over in bug 1264178.
Ah, got it. Wish I'd found it last summer, but that's really useful information. Thanks Ben!
You need to log in before you can comment on or make changes to this bug.