@smithy/fetch-http-handler 3.0.0 → 3.0.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.
package/dist-cjs/index.js CHANGED
@@ -97,12 +97,19 @@ var _FetchHttpHandler = class _FetchHttpHandler {
97
97
  const { port, method } = request;
98
98
  const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`;
99
99
  const body = method === "GET" || method === "HEAD" ? void 0 : request.body;
100
- const requestOptions = { body, headers: new Headers(request.headers), method };
100
+ const requestOptions = {
101
+ body,
102
+ headers: new Headers(request.headers),
103
+ method
104
+ };
105
+ if (body) {
106
+ requestOptions.duplex = "half";
107
+ }
101
108
  if (typeof AbortController !== "undefined") {
102
- requestOptions["signal"] = abortSignal;
109
+ requestOptions.signal = abortSignal;
103
110
  }
104
111
  if (keepAliveSupport.supported) {
105
- requestOptions["keepalive"] = keepAlive;
112
+ requestOptions.keepalive = keepAlive;
106
113
  }
107
114
  const fetchRequest = new Request(url, requestOptions);
108
115
  const raceOfPromises = [
@@ -50,12 +50,19 @@ export class FetchHttpHandler {
50
50
  const { port, method } = request;
51
51
  const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`;
52
52
  const body = method === "GET" || method === "HEAD" ? undefined : request.body;
53
- const requestOptions = { body, headers: new Headers(request.headers), method: method };
53
+ const requestOptions = {
54
+ body,
55
+ headers: new Headers(request.headers),
56
+ method: method,
57
+ };
58
+ if (body) {
59
+ requestOptions.duplex = "half";
60
+ }
54
61
  if (typeof AbortController !== "undefined") {
55
- requestOptions["signal"] = abortSignal;
62
+ requestOptions.signal = abortSignal;
56
63
  }
57
64
  if (keepAliveSupport.supported) {
58
- requestOptions["keepalive"] = keepAlive;
65
+ requestOptions.keepalive = keepAlive;
59
66
  }
60
67
  const fetchRequest = new Request(url, requestOptions);
61
68
  const raceOfPromises = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/fetch-http-handler",
3
- "version": "3.0.0",
3
+ "version": "3.0.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": "^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",