update the way requests are ended
This commit is contained in:
parent
0c03763281
commit
31b326cf51
@ -96,9 +96,12 @@ export let request = async (
|
|||||||
) {
|
) {
|
||||||
optionsArg.requestBody = JSON.stringify(optionsArg.requestBody);
|
optionsArg.requestBody = JSON.stringify(optionsArg.requestBody);
|
||||||
request.write(optionsArg.requestBody);
|
request.write(optionsArg.requestBody);
|
||||||
|
request.end();
|
||||||
} else if (optionsArg.requestBody instanceof plugins.formData) {
|
} else if (optionsArg.requestBody instanceof plugins.formData) {
|
||||||
optionsArg.requestBody.pipe(request);
|
optionsArg.requestBody.pipe(request);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
request.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
// lets handle an error
|
// lets handle an error
|
||||||
@ -116,8 +119,6 @@ export let request = async (
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
request.end();
|
|
||||||
|
|
||||||
const result = await done.promise;
|
const result = await done.promise;
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user