fix(core): update

This commit is contained in:
Philipp Kunz 2019-09-29 16:42:56 +02:00
parent 36472b7306
commit 6e31d84798
5 changed files with 14 additions and 11 deletions

View File

@ -54,7 +54,7 @@ testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
@ -65,7 +65,7 @@ testBuild:
release:
stage: release
script:
- npmci node install lts
- npmci node install stable
- npmci npm publish
only:
- tags
@ -81,6 +81,7 @@ codequality:
allow_failure: true
script:
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:

View File

@ -13,7 +13,9 @@ export interface IFormField {
const appendFormField = async (formDataArg: plugins.formData, formDataField: IFormField) => {
if (formDataField.type === 'filePath') {
const fileData = plugins.fs.readFileSync(plugins.path.join(process.cwd(), formDataField.payload));
const fileData = plugins.fs.readFileSync(
plugins.path.join(process.cwd(), formDataField.payload)
);
formDataArg.append('file', fileData, {
filename: 'upload.pdf',
contentType: 'application/pdf'
@ -30,13 +32,15 @@ export const postFormData = async (
for (const formField of payloadArg) {
await appendFormField(form, formField);
}
const requestOptions = {...optionsArg,
const requestOptions = {
...optionsArg,
method: 'POST',
headers: {
...optionsArg.headers,
...form.getHeaders()
},
requestBody: form};
requestBody: form
};
// lets fire the actual request for sending the formdata
const response = await request(urlArg, requestOptions);

View File

@ -12,6 +12,4 @@ export { formData, http, https, fs, path, url, smartpromise };
// third party scope
import * as agentkeepalive from 'agentkeepalive';
export {
agentkeepalive
};
export { agentkeepalive };

View File

@ -125,13 +125,13 @@ export let request = async (
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:
optionsArg.agent = httpAgent;
return plugins.http;
case parsedUrl.protocol === 'http:' && (!optionsArg.keepAlive):
case parsedUrl.protocol === 'http:' && !optionsArg.keepAlive:
optionsArg.agent = httpAgentKeepAliveFalse;
return plugins.http;
}