fix(core): update

This commit is contained in:
2022-08-06 22:29:12 +02:00
parent e2845c9992
commit 6600a23a00
4 changed files with 606 additions and 1836 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartrequest',
version: '2.0.9',
version: '2.0.10',
description: 'dropin replacement for request'
}

View File

@ -135,16 +135,16 @@ export let request = async (
// lets determine the request module to use
const requestModule = (() => {
switch (true) {
case parsedUrl.protocol === 'https' && optionsArg.keepAlive:
case parsedUrl.protocol === 'https:' && optionsArg.keepAlive:
optionsArg.agent = httpsAgent;
return plugins.https;
case parsedUrl.protocol === 'https' && !optionsArg.keepAlive:
case parsedUrl.protocol === 'https:' && !optionsArg.keepAlive:
optionsArg.agent = httpsAgentKeepAliveFalse;
return plugins.https;
case parsedUrl.protocol === 'http' && optionsArg.keepAlive:
case parsedUrl.protocol === 'http:' && optionsArg.keepAlive:
optionsArg.agent = httpAgent;
return plugins.http;
case parsedUrl.protocol === 'http' && !optionsArg.keepAlive:
case parsedUrl.protocol === 'http:' && !optionsArg.keepAlive:
optionsArg.agent = httpAgentKeepAliveFalse;
return plugins.http;
}