Skip to content

Commit a4b2ea8

Browse files
pivstonetrivikr
andauthored
fix NodeJS Client is using undefined http agent issue (#4453)
* test: add unit test to reproduce the issue * fix: change the update line order * chore: code lint fix * Update .changes/next-release/bugfix-NodeJS-Client-80bdf3e3.json Co-authored-by: Trivikram Kamat <[email protected]> --------- Co-authored-by: Ray Wang <> Co-authored-by: Trivikram Kamat <[email protected]>
1 parent 7e35f37 commit a4b2ea8

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "bugfix",
3+
"category": "node",
4+
"description": "use undefined node http agent if explicitly passed by user"
5+
}

lib/http/node.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ AWS.NodeHttpClient = AWS.util.inherit({
3232
path: pathPrefix + httpRequest.path
3333
};
3434

35+
AWS.util.update(options, httpOptions);
36+
3537
if (!httpOptions.agent) {
3638
options.agent = this.getAgent(useSSL, {
3739
keepAlive: process.env[CONNECTION_REUSE_ENV_NAME] === '1' ? true : false
3840
});
3941
}
4042

41-
AWS.util.update(options, httpOptions);
4243
delete options.proxy; // proxy isn't an HTTP option
4344
delete options.timeout; // timeout isn't an HTTP option
4445

test/node_http_client.spec.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)