Fix endless requests in node fetch driver

This commit is contained in:
Miroslaw Shpak 2024-03-11 11:24:55 +02:00
parent ad5f1c5fc7
commit 57bb445f41

View File

@ -37,7 +37,9 @@ export function createGetUrl(options?: Record<string, any>): FetchGetUrlFunc {
const request = ((protocol === "http") ? http: https).request(req.url, reqOptions);
request.setTimeout(req.timeout);
request.setTimeout(req.timeout, () => {
request.destroy(new Error("request timeout"));
});
const body = req.body;
if (body) { request.write(Buffer.from(body)); }