Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement referrer policy for WorkerGlobalScope #12473
Conversation
highfive
commented
Jul 16, 2016
|
Heads up! This PR modifies the following files:
|
|
I believe all of the worker test infrastructure in referrer-policy is disabled. I haven't looked into why that's the case yet. |
|
Ah I vaguely recall reading about this somewhere but can't seem to find it now. Could you point me to where exactly they're being disabled? I wasn't able to find anything in my look-around. |
|
It's the worker-request thing in spec.src.json. Maybe it's excluded, or just not included. |
bd7b820
to
17feb71
|
Updated to re-enable the worker-request tests, a bunch of which did pass :) |
|
|
99942d0
to
8bed635
|
Rebased. |
| } else { | ||
| (None, None) | ||
| }; | ||
| let referrer_url = Some(global.get_url()); |
This comment has been minimized.
This comment has been minimized.
aravind-pg
Jul 21, 2016
Author
Contributor
Note that now the field referrer_url is always Some, so I don't think it needs to stay an option any more?
This comment has been minimized.
This comment has been minimized.
|
|
8bed635
to
0c2343e
|
Rebased. |
|
I'll review this on Monday. Sorry for the wait! |
|
No problem at all. |
|
The fact that we're failing tests like |
|
Yeah I'm a bit surprised by it too. Will try to look into it more and come back if I have questions. |
|
|
|
@jdm Sorry for the delay here, I've been a bit busy with things and will continue to be for a few days more. If you have any suggestions (just high-level stuff off the top of your head) for where to start poking around to see why the tests are failing that would be super useful, but no problem at all if not, I'll just poke around myself (in a few days). |
|
Aha!
|
0c2343e
to
fe7cbad
|
@jdm Really sorry for vanishing for so long, was a busy time for me. So I reinstated worker.py as per your suggestion, but unfortunately it seems not to have made any difference. I'm really not sure what's going on here, but I'll try to dig some more. |
|
Does worker.js.template exist? If not we need to reinstate it as well. |
|
Does look like it does: worker.js.template. |
|
I took a look at the branch locally and figured out what's going on. b423496 isn't necessary any more since we're enabling the worker tests in the upstream tests, rather than our local fork. The reason why the tests are failing is that they are testing the reported referrer for the initial worker object that is created, while the changes in 33007c2 and 53cdc62 are in support of referrers for requests created from a worker script. Fixing the tests should only require modifiying the |
|
|
|
Very sorry for the extend to which this stagnated, @jdm. I think I'll just close this PR for now and perhaps open a new one when I find some time. Thanks a lot for your help, and I'll keep your last comment in mind when I reopen. |
aravind-pg commentedJul 16, 2016
•
edited
Adds a new
Option<ReferrerPolicy>field to WorkerGlobalScope and sets it appropriately by parsing the header when setting up a ServiceWorkerGlobalScope or a DedicatedWorkerGlobalScope.Also adds a new referrer policy accessor to GlobalRef and uses it in XMLHttpRequest's constructor.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is