fix(core): update

This commit is contained in:
2019-09-08 17:49:32 +02:00
parent 16a97a420c
commit acc7b2d46f
4 changed files with 7 additions and 16 deletions

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;
});
@ -97,7 +97,7 @@ export let request = async (
const defaultOptions: interfaces.ISmartRequestOptions = {
// agent: agent,
autoJsonParse: true,
keepAlive:true,
keepAlive: true
};
optionsArg = {
@ -138,15 +138,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