Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed broken fetch for Node.js > 18.x and fixed double callback #6381

Merged
merged 3 commits into from Aug 26, 2023
Merged

Fixed broken fetch for Node.js > 18.x and fixed double callback #6381

merged 3 commits into from Aug 26, 2023

Conversation

ghost
Copy link

@ghost ghost commented Aug 26, 2023

closes #5367, #6380

Description

Fixes #5367

Fixes #6380

https://stackoverflow.com/questions/73817412/why-is-the-agent-option-not-available-in-node-native-fetch

Please merge this PR as it is a CVE level bug for some environment using custom httpAgents ( Internal connections, etc ).

Without this patch, current Web3.js provider running on the latest Node.js LTS version could leak connection outside of the httpAgent proxy connections. ( As it will depend on the global.fetch which doesn't support agents natively )

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran npm run lint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • I ran npm run test:coverage and my test cases cover all the lines and branches of the added code.
  • I ran npm run build and tested dist/web3.min.js in a browser.
  • I have tested my code on the live network.
  • I have checked the Deploy Preview and it looks correct.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have linked Issue(s) with this PR in "Linked Issues" menu.

@ghost
Copy link
Author

ghost commented Aug 26, 2023

Fixed tests for Node.js 16.x version which doesn't have globalThis.fetch by default.

@jdevcs jdevcs merged commit 9e063ef into web3:1.x Aug 26, 2023
10 of 11 checks passed
@web3 web3 deleted a comment Aug 26, 2023
@jdevcs jdevcs mentioned this pull request Aug 26, 2023
@Hasinafidahussain Hasinafidahussain mentioned this pull request Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant