From b411ffd16c325e2809e8716f23dc840036e2b5dc Mon Sep 17 00:00:00 2001 From: George Fu Date: Mon, 2 Oct 2023 12:51:29 -0400 Subject: [PATCH] fix: use valid dummy URL for Node.js initialization of Request (#983) --- .changeset/five-ravens-hide.md | 5 +++++ packages/fetch-http-handler/src/fetch-http-handler.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/five-ravens-hide.md diff --git a/.changeset/five-ravens-hide.md b/.changeset/five-ravens-hide.md new file mode 100644 index 00000000000..6d643761194 --- /dev/null +++ b/.changeset/five-ravens-hide.md @@ -0,0 +1,5 @@ +--- +"@smithy/fetch-http-handler": patch +--- + +use valid dummy URL diff --git a/packages/fetch-http-handler/src/fetch-http-handler.ts b/packages/fetch-http-handler/src/fetch-http-handler.ts index 4e1b0a15e47..6ced0df06e2 100644 --- a/packages/fetch-http-handler/src/fetch-http-handler.ts +++ b/packages/fetch-http-handler/src/fetch-http-handler.ts @@ -29,7 +29,7 @@ type FetchHttpHandlerConfig = FetchHttpHandlerOptions; * Detection of keepalive support. Can be overridden for testing. */ export const keepAliveSupport = { - supported: Boolean(typeof Request !== "undefined" && "keepalive" in new Request("")), + supported: Boolean(typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]")), }; /**