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
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
2 changed files with 5 additions and 3 deletions

5
dist/index.js vendored
View File

@ -476,7 +476,8 @@ async function fetch(input_url, auth_token, redirect_count = 5) {
const options = { const options = {
hostname: url_object.hostname, hostname: url_object.hostname,
path: url_object.pathname, path: url_object.pathname,
headers: headers headers: headers,
agent: new https.Agent({ keepAlive: false })
}; };
const req = https.get(options, (res) => { const req = https.get(options, (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {
@ -1969,7 +1970,7 @@ class OidcClient {
.catch(error => { .catch(error => {
throw new Error(`Failed to get ID Token. \n throw new Error(`Failed to get ID Token. \n
Error Code : ${error.statusCode}\n Error Code : ${error.statusCode}\n
Error Message: ${error.result.message}`); Error Message: ${error.message}`);
}); });
const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;
if (!id_token) { if (!id_token) {

View File

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