Skip to content

Commit

Permalink
fix: Make IS_MAYBE_MIRAGE work in Firefox (#9360)
Browse files Browse the repository at this point in the history
- FF vs Chrome produces different `toString()` for native `window.fetch`.
- This patch fixes that.
  • Loading branch information
MichalBryxi committed Apr 16, 2024
1 parent 4d118ea commit 0be800c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/request/src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ if (DEBUG) {
Boolean(
typeof window !== 'undefined' &&
((window as { server?: { pretender: unknown } }).server?.pretender ||
window.fetch.toString() !== 'function fetch() { [native code] }')
(window.fetch.toString() !== 'function fetch() { [native code] }' &&
window.fetch.toString() !== 'function fetch() {\n [native code]\n}'))
);
}

Expand Down

0 comments on commit 0be800c

Please sign in to comment.