Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try {
url = URL.parse(options.uri, true);
} catch (e) {
throw new Error('a `uri` must be valid!');
}
if(url.protocol === 'http:') {
return new HttpAgent(options);
}
if (!(this instanceof Agent)) {
return new Agent(options);
}
HttpsAgent.call(this, options);
this.init(url, options);
}
function WrapForeverSSLAgent(opts) {
ForeverSSLAgent.call(this, opts);
var _addRequest = this.addRequest;
this.addRequest = function (req, host, port) {
req.useChunkedEncodingByDefault = false;
_addRequest.call(this, req, host, port);
};
}
inherits(WrapForeverSSLAgent, ForeverSSLAgent);