web3-providers-http: Migrate from xhr2-cookies to cross-fetch#5179
Conversation
* Update CHANGELOG.md * Migrate from xhr2-cookies to cross-fetch * Address comments for web3-providers-http * web3-providers-http: Prevent global leakage of this.connected * Return server side error without creating additional error object * Fixed type of http.Agent https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export * Removed unused variable * Remove unnecessary catch block * Remove unnecessary internal _prepareRequest function from web3-providers-http
|
Your Render PR Server URL is https://web3-js-pr-5179.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-catfv96hb05gkto4j2t0. |
| host: string; | ||
|
|
||
| withCredentials: boolean; | ||
| withCredentials?: string; |
There was a problem hiding this comment.
This will be breaking change, why we need it to be string?
There was a problem hiding this comment.
There was a problem hiding this comment.
We can remain consistent with existing 1.x https://web3js.readthedocs.io/en/v1.7.4/web3.html#configuration and have withCredentials as boolean in web3.js options obj, and based on boolean value provided by user we can pass string to fetch ( include, omit ) here and it will go as fetch wants plus we will not introduce breaking change.
There was a problem hiding this comment.
@jdevcs @nazarhussain Then it should be something more like withCredentials?: boolean | string; and handle boolean value with if block. Great idea.
Co-authored-by: Junaid <86780488+jdevcs@users.noreply.github.com>
Pull Request Test Coverage Report for Build 2595964794
💛 - Coveralls |
Description
Created the PR to merge #5085
Type of change
Checklist:
npm run dtslintwith success and extended the tests and types if necessary.npm run test:covand my test cases cover all the lines and branches of the added code.npm run buildwith success.dist/web3.min.jsin a browser.CHANGELOG.mdfile in the root folder.