From 6894b47038105fc00466c6ae4f5cec447bcb9222 Mon Sep 17 00:00:00 2001 From: Nick Randall Date: Fri, 20 Sep 2024 09:11:40 -0700 Subject: [PATCH 1/2] Fixes #1407 --- packages/fetch-http-handler/src/fetch-http-handler.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/fetch-http-handler/src/fetch-http-handler.ts b/packages/fetch-http-handler/src/fetch-http-handler.ts index 2d24b4dae5c..6f0caac4fdc 100644 --- a/packages/fetch-http-handler/src/fetch-http-handler.ts +++ b/packages/fetch-http-handler/src/fetch-http-handler.ts @@ -112,8 +112,12 @@ export class FetchHttpHandler implements HttpHandler { headers: new Headers(request.headers), method: method, credentials, - cache: this.config!.cache ?? "default", }; + // cache property is not supported in workerd runtime + // TODO: can we feature detect support for cache and not set this property when not supported? + if (this.config?.cache) { + requestOptions.cache = this.config.cache; + } if (body) { requestOptions.duplex = "half"; From 1c13b6b34c1a5d480a97100b0fcc4ad001c83fa1 Mon Sep 17 00:00:00 2001 From: Nick Randall Date: Fri, 20 Sep 2024 09:18:48 -0700 Subject: [PATCH 2/2] changeset --- .changeset/good-cheetahs-wait.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/good-cheetahs-wait.md diff --git a/.changeset/good-cheetahs-wait.md b/.changeset/good-cheetahs-wait.md new file mode 100644 index 00000000000..dcabe3dd985 --- /dev/null +++ b/.changeset/good-cheetahs-wait.md @@ -0,0 +1,5 @@ +--- +"@smithy/fetch-http-handler": patch +--- + +Omit setting cache setting on request init when using default value