fix(core): update

This commit is contained in:
2022-07-30 01:52:04 +02:00
parent 306dd7c366
commit 43710c930e
5 changed files with 11 additions and 19 deletions

View File

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

View File

@ -13,6 +13,7 @@ import * as smarturl from '@pushrocks/smarturl';
export { smartpromise, smarturl };
// third party scope
import agentkeepalive from 'agentkeepalive';
import formData from 'form-data';
export { formData };
export { agentkeepalive, formData };

View File

@ -57,7 +57,7 @@ const parseSocketPathAndRoute = (stringToParseArg: string) => {
/**
* a custom http agent to make sure we can set custom keepAlive options for speedy subsequent calls
*/
const httpAgent = new plugins.http.Agent({
const httpAgent = new plugins.agentkeepalive({
keepAlive: true,
maxFreeSockets: 1,
maxSockets: 100,
@ -75,7 +75,7 @@ const httpAgentKeepAliveFalse = new plugins.https.Agent({
/**
* a custom https agent to make sure we can set custom keepAlive options for speedy subsequent calls
*/
const httpsAgent = new plugins.https.Agent({
const httpsAgent = new plugins.agentkeepalive.HttpsAgent({
keepAlive: true,
maxFreeSockets: 1,
maxSockets: 100,
@ -85,10 +85,9 @@ const httpsAgent = new plugins.https.Agent({
/**
* a custom https agent to make sure we can set custom keepAlive options for speedy subsequent calls
*/
const httpsAgentKeepAliveFalse = new plugins.https.Agent({
const httpsAgentKeepAliveFalse = new plugins.agentkeepalive.HttpsAgent({
maxFreeSockets: 0,
keepAlive: false,
keepAliveMsecs: 0,
keepAlive: false
});
export let request = async (