Skip to content

Commit

Permalink
Set keepAlive to false. After Node 19 it is true by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Oct 29, 2023
1 parent 5469359 commit 9855c76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,8 @@ async function fetch(input_url, auth_token, redirect_count = 5) {
const options = {
hostname: url_object.hostname,
path: url_object.pathname,
headers: headers
headers: headers,
agent: new https.Agent({ keepAlive: false })
};
const req = https.get(options, (res) => {
if (res.statusCode === 200) {
Expand Down Expand Up @@ -1969,7 +1970,7 @@ class OidcClient {
.catch(error => {
throw new Error(`Failed to get ID Token. \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;
if (!id_token) {
Expand Down
3 changes: 2 additions & 1 deletion src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9855c76

Please sign in to comment.