Skip to content

Commit

Permalink
feat: allow passing a http.Agent to the grpc client (#3477)
Browse files Browse the repository at this point in the history
Follows on from #3474 and allows using http.Agents with node.js to
control the behaviour of the underlying node http client.
  • Loading branch information
achingbrain authored Jan 14, 2021
1 parent f560b4d commit a7f4fc5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"dependencies": {
"any-signal": "^2.0.0",
"bignumber.js": "^9.0.0",
"cids": "^1.0.0",
"cids": "^1.1.5",
"debug": "^4.1.1",
"form-data": "^3.0.0",
"ipfs-core-utils": "^0.5.4",
Expand Down
1 change: 0 additions & 1 deletion src/dag/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = configure((api, opts) => {
const cid = new CID(options.cid)
encodingOptions = {
...options,
// @ts-expect-error - https://github.com/multiformats/js-cid/pull/138
format: multicodec.getName(cid.code),
hashAlg: multihash.decode(cid.multihash).name
}
Expand Down
5 changes: 5 additions & 0 deletions test/node/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ describe('agent', function () {

break
}

if (i === 4) {
// should have first two responses by now
expect(responses).to.have.lengthOf(2)
}
}

// wait for the final request to arrive
Expand Down

0 comments on commit a7f4fc5

Please sign in to comment.