Skip to content

Commit

Permalink
fix url referrer wpt (#2832)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Feb 24, 2024
1 parent df1e0c1 commit 3a9723d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/web/fetch/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ function stripURLForReferrer (url, originOnly) {
// 1. Assert: url is a URL.
assert(url instanceof URL)

url = new URL(url)

// 2. If url’s scheme is a local scheme, then return no referrer.
if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {
return 'no-referrer'
Expand Down
4 changes: 1 addition & 3 deletions test/wpt/status/fetch.status.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@
"skip": true
},
"request-referrer.any.js": {
"note": "TODO(@KhafraDev): url referrer test could probably be fixed",
"fail": [
"about:client referrer",
"url referrer"
"about:client referrer"
]
},
"request-upload.any.js": {
Expand Down

0 comments on commit 3a9723d

Please sign in to comment.