Skip to content

Commit

Permalink
feat: use fetch-cookie package for cookie based sticky sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
piwonskp committed Feb 13, 2024
1 parent 09fc563 commit 5a56485
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
28 changes: 18 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"@noble/curves": "~1.3.0",
"@scure/base": "~1.1.3",
"@scure/starknet": "~1.0.0",
"fetch-cookie": "github:NethermindEth/fetch-cookie#export-cookieimpl",
"abi-wan-kanabi-v1": "npm:abi-wan-kanabi@^1.0.3",
"abi-wan-kanabi-v2": "npm:abi-wan-kanabi@^2.1.1",
"isomorphic-fetch": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/utils/fetchPonyfill.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import makeFetchCookie from 'fetch-cookie';
import isomorphicFetch from 'isomorphic-fetch';

export default (typeof window !== 'undefined' && window.fetch) || // use buildin fetch in browser if available
(typeof global !== 'undefined' && global.fetch) || // use buildin fetch in node, react-native and service worker if available
(typeof global !== 'undefined' && makeFetchCookie(global.fetch)) || // use buildin fetch in node, react-native and service worker if available
isomorphicFetch; // ponyfill fetch in node and browsers that don't have it

0 comments on commit 5a56485

Please sign in to comment.