@smithy/fetch-http-handler 5.0.3 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-cjs/index.js CHANGED
@@ -83,11 +83,11 @@ var FetchHttpHandler = class _FetchHttpHandler {
83
83
  }
84
84
  destroy() {
85
85
  }
86
- async handle(request, { abortSignal } = {}) {
86
+ async handle(request, { abortSignal, requestTimeout: requestTimeout2 } = {}) {
87
87
  if (!this.config) {
88
88
  this.config = await this.configProvider;
89
89
  }
90
- const requestTimeoutInMs = this.config.requestTimeout;
90
+ const requestTimeoutInMs = requestTimeout2 ?? this.config.requestTimeout;
91
91
  const keepAlive = this.config.keepAlive === true;
92
92
  const credentials = this.config.credentials;
93
93
  if (abortSignal?.aborted) {
@@ -1,7 +1,7 @@
1
1
  import { HttpResponse } from "@smithy/protocol-http";
2
2
  import { buildQueryString } from "@smithy/querystring-builder";
3
3
  import { createRequest } from "./create-request";
4
- import { requestTimeout } from "./request-timeout";
4
+ import { requestTimeout as requestTimeoutFn } from "./request-timeout";
5
5
  export const keepAliveSupport = {
6
6
  supported: undefined,
7
7
  };
@@ -26,11 +26,11 @@ export class FetchHttpHandler {
26
26
  }
27
27
  destroy() {
28
28
  }
29
- async handle(request, { abortSignal } = {}) {
29
+ async handle(request, { abortSignal, requestTimeout } = {}) {
30
30
  if (!this.config) {
31
31
  this.config = await this.configProvider;
32
32
  }
33
- const requestTimeoutInMs = this.config.requestTimeout;
33
+ const requestTimeoutInMs = requestTimeout ?? this.config.requestTimeout;
34
34
  const keepAlive = this.config.keepAlive === true;
35
35
  const credentials = this.config.credentials;
36
36
  if (abortSignal?.aborted) {
@@ -105,7 +105,7 @@ export class FetchHttpHandler {
105
105
  }),
106
106
  };
107
107
  }),
108
- requestTimeout(requestTimeoutInMs),
108
+ requestTimeoutFn(requestTimeoutInMs),
109
109
  ];
110
110
  if (abortSignal) {
111
111
  raceOfPromises.push(new Promise((resolve, reject) => {
@@ -33,7 +33,7 @@ export declare class FetchHttpHandler implements HttpHandler<FetchHttpHandlerOpt
33
33
  static create(instanceOrOptions?: HttpHandler<any> | FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>): FetchHttpHandler | HttpHandler<any>;
34
34
  constructor(options?: FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>);
35
35
  destroy(): void;
36
- handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
36
+ handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
37
37
  response: HttpResponse;
38
38
  }>;
39
39
  updateHttpClientConfig(key: keyof FetchHttpHandlerOptions, value: FetchHttpHandlerOptions[typeof key]): void;
@@ -33,7 +33,7 @@ export declare class FetchHttpHandler implements HttpHandler<FetchHttpHandlerOpt
33
33
  static create(instanceOrOptions?: HttpHandler<any> | FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>): FetchHttpHandler | HttpHandler<any>;
34
34
  constructor(options?: FetchHttpHandlerOptions | Provider<FetchHttpHandlerOptions | void>);
35
35
  destroy(): void;
36
- handle(request: HttpRequest, { abortSignal }?: HttpHandlerOptions): Promise<{
36
+ handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{
37
37
  response: HttpResponse;
38
38
  }>;
39
39
  updateHttpClientConfig(key: keyof FetchHttpHandlerOptions, value: FetchHttpHandlerOptions[typeof key]): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/fetch-http-handler",
3
- "version": "5.0.3",
3
+ "version": "5.1.0",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
@@ -27,14 +27,14 @@
27
27
  "module": "./dist-es/index.js",
28
28
  "types": "./dist-types/index.d.ts",
29
29
  "dependencies": {
30
- "@smithy/protocol-http": "^5.1.1",
31
- "@smithy/querystring-builder": "^4.0.3",
32
- "@smithy/types": "^4.3.0",
30
+ "@smithy/protocol-http": "^5.1.2",
31
+ "@smithy/querystring-builder": "^4.0.4",
32
+ "@smithy/types": "^4.3.1",
33
33
  "@smithy/util-base64": "^4.0.0",
34
34
  "tslib": "^2.6.2"
35
35
  },
36
36
  "devDependencies": {
37
- "@smithy/abort-controller": "^4.0.3",
37
+ "@smithy/abort-controller": "^4.0.4",
38
38
  "concurrently": "7.0.0",
39
39
  "downlevel-dts": "0.10.1",
40
40
  "rimraf": "3.0.2",