-
-
Notifications
You must be signed in to change notification settings - Fork 687
Closed
Labels
bugSomething isn't workingSomething isn't workingfetchgood first issueGood for newcomersGood for newcomers
Description
I'll get around to fixing it, but it could be a good first issue for someone who wants to dive into the code but doesn't know where to start. Here's why the bug occurs:
The referrerPolicy is being set to undefined here
Lines 557 to 559 in bc8e2b8
| if (request.referrerPolicy === '') { | |
| request.referrerPolicy = request.policyContainer.referrerPolicy | |
| } |
because we don't implement policyContainers:
Lines 328 to 338 in bc8e2b8
| // https://html.spec.whatwg.org/multipage/origin.html#policy-container | |
| function makePolicyContainer () { | |
| // TODO | |
| return {} | |
| } | |
| // https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container | |
| function clonePolicyContainer () { | |
| // TODO | |
| return {} | |
| } |
which causes this condition to trigger
Lines 346 to 348 in bc8e2b8
| if (policy == null || policy === '' || policy === 'no-referrer') { | |
| return 'no-referrer' | |
| } |
which means the header is never appended here
Lines 1333 to 1335 in bc8e2b8
| if (httpRequest.referrer instanceof URL) { | |
| httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href)) | |
| } |
The easiest fix is to implement makePolicyContainer and clonePolicyContainer (both are used). Follow the steps in the links above the methods (and include the steps as comments). A "list" is an array.
metcoder95
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfetchgood first issueGood for newcomersGood for newcomers