node-modules/agentkeepalive

bug: constructor mutates it's argument (options)

adrian-gierakowski opened this issue · 0 comments

for example here:

options = options || {};
options.keepAlive = options.keepAlive !== false;
// default is keep-alive and 15s free socket timeout
if (options.freeSocketTimeout === undefined) {
options.freeSocketTimeout = 15000;
}

If the options argument is defined it should be cloned before having it's props mutated.

I'm happy to submit a PR, just wanted to check that the author agrees with the suggestion