@smithy/fetch-http-handler 2.2.2 → 2.2.4
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.
|
@@ -20,12 +20,12 @@ class FetchHttpHandler {
|
|
|
20
20
|
destroy() {
|
|
21
21
|
}
|
|
22
22
|
async handle(request, { abortSignal } = {}) {
|
|
23
|
-
var _a, _b
|
|
23
|
+
var _a, _b;
|
|
24
24
|
if (!this.config) {
|
|
25
25
|
this.config = await this.configProvider;
|
|
26
26
|
}
|
|
27
27
|
const requestTimeoutInMs = this.config.requestTimeout;
|
|
28
|
-
const keepAlive =
|
|
28
|
+
const keepAlive = this.config.keepAlive === true;
|
|
29
29
|
if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) {
|
|
30
30
|
const abortError = new Error("Request aborted");
|
|
31
31
|
abortError.name = "AbortError";
|
|
@@ -41,8 +41,8 @@ class FetchHttpHandler {
|
|
|
41
41
|
}
|
|
42
42
|
let auth = "";
|
|
43
43
|
if (request.username != null || request.password != null) {
|
|
44
|
-
const username = (
|
|
45
|
-
const password = (
|
|
44
|
+
const username = (_a = request.username) !== null && _a !== void 0 ? _a : "";
|
|
45
|
+
const password = (_b = request.password) !== null && _b !== void 0 ? _b : "";
|
|
46
46
|
auth = `${username}:${password}@`;
|
|
47
47
|
}
|
|
48
48
|
const { port, method } = request;
|
|
@@ -21,7 +21,7 @@ export class FetchHttpHandler {
|
|
|
21
21
|
this.config = await this.configProvider;
|
|
22
22
|
}
|
|
23
23
|
const requestTimeoutInMs = this.config.requestTimeout;
|
|
24
|
-
const keepAlive = this.config.keepAlive
|
|
24
|
+
const keepAlive = this.config.keepAlive === true;
|
|
25
25
|
if (abortSignal?.aborted) {
|
|
26
26
|
const abortError = new Error("Request aborted");
|
|
27
27
|
abortError.name = "AbortError";
|
|
@@ -10,7 +10,13 @@ export interface FetchHttpHandlerOptions {
|
|
|
10
10
|
*/
|
|
11
11
|
requestTimeout?: number;
|
|
12
12
|
/**
|
|
13
|
-
* Whether to allow the request to outlive the page. Default value is
|
|
13
|
+
* Whether to allow the request to outlive the page. Default value is false.
|
|
14
|
+
*
|
|
15
|
+
* There may be limitations to the payload size, number of concurrent requests,
|
|
16
|
+
* request duration etc. when using keepalive in browsers.
|
|
17
|
+
*
|
|
18
|
+
* These may change over time, so look for up to date information about
|
|
19
|
+
* these limitations before enabling keepalive.
|
|
14
20
|
*/
|
|
15
21
|
keepAlive?: boolean;
|
|
16
22
|
}
|
|
@@ -10,7 +10,13 @@ export interface FetchHttpHandlerOptions {
|
|
|
10
10
|
*/
|
|
11
11
|
requestTimeout?: number;
|
|
12
12
|
/**
|
|
13
|
-
* Whether to allow the request to outlive the page. Default value is
|
|
13
|
+
* Whether to allow the request to outlive the page. Default value is false.
|
|
14
|
+
*
|
|
15
|
+
* There may be limitations to the payload size, number of concurrent requests,
|
|
16
|
+
* request duration etc. when using keepalive in browsers.
|
|
17
|
+
*
|
|
18
|
+
* These may change over time, so look for up to date information about
|
|
19
|
+
* these limitations before enabling keepalive.
|
|
14
20
|
*/
|
|
15
21
|
keepAlive?: boolean;
|
|
16
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/fetch-http-handler",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
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": "^3.0.
|
|
28
|
-
"@smithy/querystring-builder": "^2.0.
|
|
29
|
-
"@smithy/types": "^2.
|
|
27
|
+
"@smithy/protocol-http": "^3.0.8",
|
|
28
|
+
"@smithy/querystring-builder": "^2.0.12",
|
|
29
|
+
"@smithy/types": "^2.4.0",
|
|
30
30
|
"@smithy/util-base64": "^2.0.0",
|
|
31
31
|
"tslib": "^2.5.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@smithy/abort-controller": "^2.0.
|
|
34
|
+
"@smithy/abort-controller": "^2.0.12",
|
|
35
35
|
"@tsconfig/recommended": "1.0.1",
|
|
36
36
|
"@types/chai-as-promised": "^7.1.2",
|
|
37
37
|
"chai": "^4.2.0",
|