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

Update xhr2-cookies deps for 1.x, fix User-Agent header problem #4796

Closed
wants to merge 1 commit into from
Closed

Update xhr2-cookies deps for 1.x, fix User-Agent header problem #4796

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 27, 2022

Description

Unlike ethers.js, web3.js didn't support using custom User-Agent headers due to header restrictions inherited from the old, unmaintained xhr2-cookies dependencies.

Related issues:

#1803
#2158

Using old dependency would expose the OS and nodejs version to RPC providers.

Due to this problem, there are many forks of the old dependencies exist https://www.npmjs.com/package/xhr2-cookies-web3fix , only to fix this old restriction applied.

See also

souldreamer/xhr2-cookies#30

Type of change

Changed only dependencies to local, github fork https://github.com/0xAyanami/xhr2-cookies.git. Would be great if the ChainSafe or any web3.js maintainer could fork my commits and change the repository address.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

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 dtslint with success and extended the tests and types if necessary.
  • I ran npm run test:unit with success.
  • I ran npm run test:cov 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.

@ghost ghost changed the title Update xhr2-cookies deps for 1.x Update xhr2-cookies deps for 1.x, fix User-Agent header problem Feb 27, 2022
@nazarhussain
Copy link
Contributor

@0xayanami We don't recommend using any dependency which is not publicly released. Please create your PR against xhr2-cookies package, as soon they release the fix we will update our dependencies, or you can also open PR updating dependency version.

@ghost
Copy link
Author

ghost commented Mar 2, 2022

@nazarhussain Created new PR #4808 that updates dependency version as I would see that maintainers of xhr2-cookies package gone afk for a long time. ( I think incident from Ukraine have some impact for them )

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.

None yet

1 participant