Skip to content

Commit

Permalink
We need to bind fetch() in a browser
Browse files Browse the repository at this point in the history
  • Loading branch information
amrc-benmorrow committed Mar 12, 2024
1 parent 681a2d2 commit 2962c59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/service/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default class Fetch extends ServiceInterface {
async _real_fetch (...args) {
if (this.fplus.opts.browser) {
this.debug.log("fetch", "Using native fetch() implementation");
this._real_fetch = globalThis.fetch;
this._real_fetch = globalThis.fetch.bind(globalThis);
}
else {
this.debug.log("fetch", "Using got-fetch for NodeJS");
Expand Down

0 comments on commit 2962c59

Please sign in to comment.