@smithy/fetch-http-handler 3.0.1 → 3.0.3

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
@@ -46,7 +46,7 @@ __name(requestTimeout, "requestTimeout");
46
46
 
47
47
  // src/fetch-http-handler.ts
48
48
  var keepAliveSupport = {
49
- supported: Boolean(typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]"))
49
+ supported: void 0
50
50
  };
51
51
  var _FetchHttpHandler = class _FetchHttpHandler {
52
52
  /**
@@ -66,6 +66,11 @@ var _FetchHttpHandler = class _FetchHttpHandler {
66
66
  this.config = options ?? {};
67
67
  this.configProvider = Promise.resolve(this.config);
68
68
  }
69
+ if (keepAliveSupport.supported === void 0) {
70
+ keepAliveSupport.supported = Boolean(
71
+ typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]")
72
+ );
73
+ }
69
74
  }
70
75
  destroy() {
71
76
  }
@@ -2,7 +2,7 @@ import { HttpResponse } from "@smithy/protocol-http";
2
2
  import { buildQueryString } from "@smithy/querystring-builder";
3
3
  import { requestTimeout } from "./request-timeout";
4
4
  export const keepAliveSupport = {
5
- supported: Boolean(typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]")),
5
+ supported: undefined,
6
6
  };
7
7
  export class FetchHttpHandler {
8
8
  static create(instanceOrOptions) {
@@ -19,6 +19,9 @@ export class FetchHttpHandler {
19
19
  this.config = options ?? {};
20
20
  this.configProvider = Promise.resolve(this.config);
21
21
  }
22
+ if (keepAliveSupport.supported === undefined) {
23
+ keepAliveSupport.supported = Boolean(typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]"));
24
+ }
22
25
  }
23
26
  destroy() {
24
27
  }
@@ -8,7 +8,7 @@ type FetchHttpHandlerConfig = FetchHttpHandlerOptions;
8
8
  * Detection of keepalive support. Can be overridden for testing.
9
9
  */
10
10
  export declare const keepAliveSupport: {
11
- supported: boolean;
11
+ supported: boolean | undefined;
12
12
  };
13
13
  /**
14
14
  * @public
@@ -8,7 +8,7 @@ type FetchHttpHandlerConfig = FetchHttpHandlerOptions;
8
8
  * Detection of keepalive support. Can be overridden for testing.
9
9
  */
10
10
  export declare const keepAliveSupport: {
11
- supported: boolean;
11
+ supported: boolean | undefined;
12
12
  };
13
13
  /**
14
14
  * @public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/fetch-http-handler",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
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'",
@@ -24,14 +24,14 @@
24
24
  "module": "./dist-es/index.js",
25
25
  "types": "./dist-types/index.d.ts",
26
26
  "dependencies": {
27
- "@smithy/protocol-http": "^4.0.0",
28
- "@smithy/querystring-builder": "^3.0.0",
29
- "@smithy/types": "^3.0.0",
27
+ "@smithy/protocol-http": "^4.0.1",
28
+ "@smithy/querystring-builder": "^3.0.1",
29
+ "@smithy/types": "^3.1.0",
30
30
  "@smithy/util-base64": "^3.0.0",
31
31
  "tslib": "^2.6.2"
32
32
  },
33
33
  "devDependencies": {
34
- "@smithy/abort-controller": "^3.0.0",
34
+ "@smithy/abort-controller": "^3.0.1",
35
35
  "concurrently": "7.0.0",
36
36
  "downlevel-dts": "0.10.1",
37
37
  "rimraf": "3.0.2",