pkgs: add http headers to ethers providers#1692
Conversation
🦋 Changeset detectedLatest commit: 6ae2fe9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Adds the http header 'User-Agent' to the creation of ethers providers across the services to allow for more visibility into what services are sending requests. Also delete dead imports since they were breaking during linting.
366c18a to
6ae2fe9
Compare
|
@tynes will this help us get better visibility for the connections that are going through external providers like Alchemy or Infura? |
Codecov Report
@@ Coverage Diff @@
## regenesis/0.5.0 #1692 +/- ##
===================================================
- Coverage 72.71% 72.58% -0.13%
===================================================
Files 69 69
Lines 2272 2276 +4
Branches 336 337 +1
===================================================
Hits 1652 1652
- Misses 620 624 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
annieke
left a comment
There was a problem hiding this comment.
this is a great change!!
| const urls = config.split(',') | ||
| for (const [i, url] of urls.entries()) { | ||
| const connectionInfo: ConnectionInfo = { url } | ||
| if (typeof headers === 'object') { |
There was a problem hiding this comment.
what does this if statement protect against?
There was a problem hiding this comment.
It lets you not pass in the headers object without assigning undefined to the object, its more of a safety thing but i suppose the code is the same without it
No, but our proxy will be able to view them |
Description
Adds the http header 'User-Agent' to the creation
of ethers providers across the services to allow
for more visibility into what services are sending
requests.
Also delete dead imports since they were breaking
during linting.