Skip to content

Commit 0d5ab1d

Browse files
authored
fix(node-http-handler): omit setting cache setting on request init when using default value (#1411)
* Fixes #1407
1 parent 71b163b commit 0d5ab1d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/good-cheetahs-wait.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@smithy/fetch-http-handler": patch
3+
---
4+
5+
Omit setting cache setting on request init when using default value

packages/fetch-http-handler/src/fetch-http-handler.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@ export class FetchHttpHandler implements HttpHandler<FetchHttpHandlerConfig> {
112112
headers: new Headers(request.headers),
113113
method: method,
114114
credentials,
115-
cache: this.config!.cache ?? "default",
116115
};
116+
// cache property is not supported in workerd runtime
117+
// TODO: can we feature detect support for cache and not set this property when not supported?
118+
if (this.config?.cache) {
119+
requestOptions.cache = this.config.cache;
120+
}
117121

118122
if (body) {
119123
requestOptions.duplex = "half";

0 commit comments

Comments
 (0)