From cb0679f04b1f09629676f545c714f58ac6e173b6 Mon Sep 17 00:00:00 2001 From: Kenneth Sills <132029135+Kenneth-Sills@users.noreply.github.com> Date: Fri, 6 Dec 2024 02:38:20 +0000 Subject: [PATCH 1/3] fix: prevent timeouts on Node 19+ Closes #362 --- .changeset/friendly-bats-shave.md | 5 +++++ src/utils/http-client/get-modules/http.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/friendly-bats-shave.md diff --git a/.changeset/friendly-bats-shave.md b/.changeset/friendly-bats-shave.md new file mode 100644 index 00000000..022542b0 --- /dev/null +++ b/.changeset/friendly-bats-shave.md @@ -0,0 +1,5 @@ +--- +"eslint-plugin-json-schema-validator": patch +--- + +prevent timeouts on Node 19+ diff --git a/src/utils/http-client/get-modules/http.ts b/src/utils/http-client/get-modules/http.ts index c6e9c6c3..0dfda2d3 100644 --- a/src/utils/http-client/get-modules/http.ts +++ b/src/utils/http-client/get-modules/http.ts @@ -76,6 +76,7 @@ function parseUrlAndOptions(urlStr: string, baseOptions: RequestOptions) { protocol: url.protocol, hostname, path: `${url.pathname || ""}${url.search || ""}`, + agent: false, }; if (url.port !== "") { options.port = Number(url.port); From a182b62beb29865349f5abee8bd6e853b7a2cdce Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Fri, 6 Dec 2024 12:47:30 +0900 Subject: [PATCH 2/3] Update friendly-bats-shave.md --- .changeset/friendly-bats-shave.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/friendly-bats-shave.md b/.changeset/friendly-bats-shave.md index 022542b0..25cb90f5 100644 --- a/.changeset/friendly-bats-shave.md +++ b/.changeset/friendly-bats-shave.md @@ -1,5 +1,5 @@ --- -"eslint-plugin-json-schema-validator": patch +"eslint-plugin-json-schema-validator": minor --- prevent timeouts on Node 19+ From 80639346f88e9a5b10491e59254e071a88362e7b Mon Sep 17 00:00:00 2001 From: Kenneth Sills <132029135+Kenneth-Sills@users.noreply.github.com> Date: Fri, 6 Dec 2024 04:07:13 +0000 Subject: [PATCH 3/3] fix: preserve customizability of HTTP agent --- src/utils/http-client/get-modules/http.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/http-client/get-modules/http.ts b/src/utils/http-client/get-modules/http.ts index 0dfda2d3..2fbaff81 100644 --- a/src/utils/http-client/get-modules/http.ts +++ b/src/utils/http-client/get-modules/http.ts @@ -72,11 +72,11 @@ function parseUrlAndOptions(urlStr: string, baseOptions: RequestOptions) { ? url.hostname.slice(1, -1) : url.hostname; const options: RequestOptions = { + agent: false, ...baseOptions, protocol: url.protocol, hostname, path: `${url.pathname || ""}${url.search || ""}`, - agent: false, }; if (url.port !== "") { options.port = Number(url.port);