diff --git a/.changeset/sixty-scissors-bake.md b/.changeset/sixty-scissors-bake.md new file mode 100644 index 00000000000..ec407ced5d8 --- /dev/null +++ b/.changeset/sixty-scissors-bake.md @@ -0,0 +1,5 @@ +--- +"@smithy/fetch-http-handler": patch +--- + +set keepalive default to false in fetch handler diff --git a/packages/fetch-http-handler/src/fetch-http-handler.ts b/packages/fetch-http-handler/src/fetch-http-handler.ts index 6ced0df06e2..f0c1c9255e3 100644 --- a/packages/fetch-http-handler/src/fetch-http-handler.ts +++ b/packages/fetch-http-handler/src/fetch-http-handler.ts @@ -17,7 +17,13 @@ export interface FetchHttpHandlerOptions { requestTimeout?: number; /** - * Whether to allow the request to outlive the page. Default value is true + * Whether to allow the request to outlive the page. Default value is false. + * + * There may be limitations to the payload size, number of concurrent requests, + * request duration etc. when using keepalive in browsers. + * + * These may change over time, so look for up to date information about + * these limitations before enabling keepalive. */ keepAlive?: boolean; } @@ -59,7 +65,7 @@ export class FetchHttpHandler implements HttpHandler { this.config = await this.configProvider; } const requestTimeoutInMs = this.config!.requestTimeout; - const keepAlive = this.config!.keepAlive ?? true; + const keepAlive = this.config!.keepAlive === true; // if the request was already aborted, prevent doing extra work if (abortSignal?.aborted) {