Skip to content

Commit

Permalink
lib/request-browser: fix for node.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Dec 16, 2023
1 parent b263754 commit 1794d95
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/request-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class RequestOptions {
getHeaders() {
const headers = new Headers();

let referrer = 'no-referrer';
let referrer = null;

// https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name
if (this.agent != null)
Expand Down Expand Up @@ -277,8 +277,7 @@ class RequestOptions {
mode: 'cors',
credentials: auth ? 'include' : 'omit',
cache: 'no-store',
redirect: 'follow',
referrer
redirect: 'follow'
};

if (this.body != null) {
Expand All @@ -291,6 +290,9 @@ class RequestOptions {
}
}

if (referrer != null)
options.referrer = referrer;

return options;
}
}
Expand Down

0 comments on commit 1794d95

Please sign in to comment.