Compare commits

...

4 Commits

Author SHA1 Message Date
36f2707141 1.1.26 2019-09-08 17:57:28 +02:00
b00d674b6f fix(core): update 2019-09-08 17:57:28 +02:00
b09598d465 1.1.25 2019-09-08 17:49:33 +02:00
acc7b2d46f fix(core): update 2019-09-08 17:49:32 +02:00
5 changed files with 12 additions and 19 deletions

View File

@ -38,11 +38,11 @@ snyk:
# test stage
# ====================
testLTS:
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
@ -100,7 +100,7 @@ trigger:
pages:
image: hosttoday/ht-docker-dbase:npmci
services:
- docker:18-dind
- docker:stable-dind
stage: metadata
script:
- npmci command npm install -g @gitzone/tsdoc

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartrequest",
"version": "1.1.24",
"version": "1.1.26",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartrequest",
"version": "1.1.24",
"version": "1.1.26",
"private": false,
"description": "dropin replacement for request",
"main": "dist/index.js",

View File

@ -1,4 +1,4 @@
import * as formData from 'form-data';
import formData from 'form-data';
import * as fs from 'fs';
import * as http from 'http';
import * as https from 'https';

View File

@ -14,7 +14,7 @@ const buildUtf8Response = (
const done = plugins.smartpromise.defer<IExtendedIncomingMessage>();
// Continuously update stream with data
let body = '';
incomingMessageArg.on('data', (chunkArg) => {
incomingMessageArg.on('data', chunkArg => {
body += chunkArg;
});
@ -66,8 +66,9 @@ const httpAgent = new plugins.http.Agent({
* a custom http agent to make sure we can set custom keepAlive options for speedy subsequent calls
*/
const httpAgentKeepAliveFalse = new plugins.http.Agent({
maxFreeSockets: 0,
keepAlive: false,
keepAliveMsecs: 600000
keepAliveMsecs: 0
});
/**
@ -82,8 +83,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({
maxFreeSockets: 0,
keepAlive: false,
keepAliveMsecs: 600000
keepAliveMsecs: 0
});
export let request = async (
@ -97,7 +99,7 @@ export let request = async (
const defaultOptions: interfaces.ISmartRequestOptions = {
// agent: agent,
autoJsonParse: true,
keepAlive:true,
keepAlive: true
};
optionsArg = {
@ -138,15 +140,6 @@ export let request = async (
optionsArg.agent = httpAgentKeepAliveFalse;
return plugins.http;
}
if () {
optionsArg.agent = httpsAgent;
return plugins.https;
} else if (parsedUrl.protocol === 'http:') {
optionsArg.agent = httpAgent;
return plugins.http;
} else {
throw new Error(`unsupported protocol: ${parsedUrl.protocol}`);
}
})() as typeof plugins.https;
// lets perform the actual request