Set keepAlive to false. After Node 19 it is true by default.

This commit is contained in:
Shivam Mathur
2023-10-30 01:38:35 +05:30
parent 546935924a
commit 9855c76987
2 changed files with 5 additions and 3 deletions

View File

@ -26,7 +26,8 @@ export async function fetch(
const options: https.RequestOptions = {
hostname: url_object.hostname,
path: url_object.pathname,
headers: headers
headers: headers,
agent: new https.Agent({keepAlive: false})
};
const req = https.get(options, (res: IncomingMessage) => {
if (res.statusCode === 200) {