Fix endless requests in node fetch driver
This commit is contained in:
parent
ad5f1c5fc7
commit
57bb445f41
@ -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)); }
|
||||
|
Loading…
Reference in New Issue
Block a user