Bypassed request's referrerPolicy is reset to default #1380
Labels
bug
Something isn't working
help wanted
Extra attention is needed
needs:triage
Issues that have not been investigated yet.
scope:browser
Related to MSW running in a browser
Prerequisites
Environment check
msw
versionBrowsers
Chromium (Chrome, Brave, etc.)
Reproduction repository
https://github.com/ne2030/msw-issue
Reproduction steps
python -m SimpleHTTPServer 8001
for Python 2.x, orpython3 -m http.server 8001
for Python 3.x.Reproduction repository does not use MSW directly, instead, focuses on Fetch issue.
Current behavior
Referrer policy is reset to default 'strict-origin-when-cross-origin' when the request is fetched with cloned request and custom options.
Here, if any options are passed as a second argument to fetch API, then the referrer policy is reset! I don't know the exact cause of this problem, but it can be solved below.
Or, I saw msw condesandbox and there, this problem is not reproduced and found out mockserviceworker.js file is different from deployed version (0.45.0). I think the version on condsandbox that creates a new Request instance and uses this directly as argument with no options at Fetch can also handle this problem.
The below screenshots are for reference.
Expected behavior
Preserve original option of request (especially referrerPolicy and referrer)
The text was updated successfully, but these errors were encountered: