fix(core): update
This commit is contained in:
@ -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';
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user