@smithy/fetch-http-handler 2.2.0 → 2.2.2

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.
@@ -5,7 +5,7 @@ const protocol_http_1 = require("@smithy/protocol-http");
5
5
  const querystring_builder_1 = require("@smithy/querystring-builder");
6
6
  const request_timeout_1 = require("./request-timeout");
7
7
  exports.keepAliveSupport = {
8
- supported: Boolean(typeof Request !== "undefined" && "keepalive" in new Request("")),
8
+ supported: Boolean(typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]")),
9
9
  };
10
10
  class FetchHttpHandler {
11
11
  constructor(options) {
@@ -48,11 +48,7 @@ class FetchHttpHandler {
48
48
  const { port, method } = request;
49
49
  const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`;
50
50
  const body = method === "GET" || method === "HEAD" ? undefined : request.body;
51
- const requestOptions = {
52
- body,
53
- headers: new Headers(request.headers),
54
- method: method,
55
- };
51
+ const requestOptions = { body, headers: new Headers(request.headers), method: method };
56
52
  if (typeof AbortController !== "undefined") {
57
53
  requestOptions["signal"] = abortSignal;
58
54
  }
@@ -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("")),
5
+ supported: Boolean(typeof Request !== "undefined" && "keepalive" in new Request("https://[::1]")),
6
6
  };
7
7
  export class FetchHttpHandler {
8
8
  constructor(options) {
@@ -44,11 +44,7 @@ export class FetchHttpHandler {
44
44
  const { port, method } = request;
45
45
  const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`;
46
46
  const body = method === "GET" || method === "HEAD" ? undefined : request.body;
47
- const requestOptions = {
48
- body,
49
- headers: new Headers(request.headers),
50
- method: method,
51
- };
47
+ const requestOptions = { body, headers: new Headers(request.headers), method: method };
52
48
  if (typeof AbortController !== "undefined") {
53
49
  requestOptions["signal"] = abortSignal;
54
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/fetch-http-handler",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
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.6",
28
- "@smithy/querystring-builder": "^2.0.10",
29
- "@smithy/types": "^2.3.4",
27
+ "@smithy/protocol-http": "^3.0.7",
28
+ "@smithy/querystring-builder": "^2.0.11",
29
+ "@smithy/types": "^2.3.5",
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.10",
34
+ "@smithy/abort-controller": "^2.0.11",
35
35
  "@tsconfig/recommended": "1.0.1",
36
36
  "@types/chai-as-promised": "^7.1.2",
37
37
  "chai": "^4.2.0",