@aws-sdk/eventstream-handler-node 3.609.0 → 3.649.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
@@ -96,6 +96,7 @@ var _EventStreamPayloadHandler = class _EventStreamPayloadHandler {
96
96
  this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;
97
97
  }
98
98
  async handle(next, args, context = {}) {
99
+ var _a, _b;
99
100
  const request = args.request;
100
101
  const { body: payload, query } = request;
101
102
  if (!(payload instanceof import_stream.Readable)) {
@@ -105,15 +106,8 @@ var _EventStreamPayloadHandler = class _EventStreamPayloadHandler {
105
106
  request.body = new import_stream.PassThrough({
106
107
  objectMode: true
107
108
  });
108
- let result;
109
- try {
110
- result = await next(args);
111
- } catch (e) {
112
- request.body.end();
113
- throw e;
114
- }
115
- const match = (request.headers["authorization"] || "").match(/Signature=([\w]+)$/);
116
- const priorSignature = (match || [])[1] || query && query["X-Amz-Signature"] || "";
109
+ const match = (_b = (_a = request.headers) == null ? void 0 : _a.authorization) == null ? void 0 : _b.match(/Signature=([\w]+)$/);
110
+ const priorSignature = (match == null ? void 0 : match[1]) ?? (query == null ? void 0 : query["X-Amz-Signature"]) ?? "";
117
111
  const signingStream = new EventSigningStream({
118
112
  priorSignature,
119
113
  eventStreamCodec: this.eventStreamCodec,
@@ -125,6 +119,13 @@ var _EventStreamPayloadHandler = class _EventStreamPayloadHandler {
125
119
  throw err;
126
120
  }
127
121
  });
122
+ let result;
123
+ try {
124
+ result = await next(args);
125
+ } catch (e) {
126
+ request.body.end();
127
+ throw e;
128
+ }
128
129
  return result;
129
130
  }
130
131
  };
@@ -17,16 +17,8 @@ export class EventStreamPayloadHandler {
17
17
  request.body = new PassThrough({
18
18
  objectMode: true,
19
19
  });
20
- let result;
21
- try {
22
- result = await next(args);
23
- }
24
- catch (e) {
25
- request.body.end();
26
- throw e;
27
- }
28
- const match = (request.headers["authorization"] || "").match(/Signature=([\w]+)$/);
29
- const priorSignature = (match || [])[1] || (query && query["X-Amz-Signature"]) || "";
20
+ const match = request.headers?.authorization?.match(/Signature=([\w]+)$/);
21
+ const priorSignature = match?.[1] ?? query?.["X-Amz-Signature"] ?? "";
30
22
  const signingStream = new EventSigningStream({
31
23
  priorSignature,
32
24
  eventStreamCodec: this.eventStreamCodec,
@@ -38,6 +30,14 @@ export class EventStreamPayloadHandler {
38
30
  throw err;
39
31
  }
40
32
  });
33
+ let result;
34
+ try {
35
+ result = await next(args);
36
+ }
37
+ catch (e) {
38
+ request.body.end();
39
+ throw e;
40
+ }
41
41
  return result;
42
42
  }
43
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/eventstream-handler-node",
3
- "version": "3.609.0",
3
+ "version": "3.649.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "node ../../scripts/compilation/inline eventstream-handler-node",
@@ -20,9 +20,9 @@
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@aws-sdk/types": "3.609.0",
24
- "@smithy/eventstream-codec": "^3.1.2",
25
- "@smithy/types": "^3.3.0",
23
+ "@aws-sdk/types": "3.649.0",
24
+ "@smithy/eventstream-codec": "^3.1.3",
25
+ "@smithy/types": "^3.4.0",
26
26
  "tslib": "^2.6.2"
27
27
  },
28
28
  "devDependencies": {