@middy/ws-response 5.2.0 → 5.2.1

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.
Files changed (2) hide show
  1. package/index.js +10 -2
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -3,7 +3,12 @@ import {
3
3
  PostToConnectionCommand
4
4
  } from '@aws-sdk/client-apigatewaymanagementapi'
5
5
 
6
- import { canPrefetch, createClient, createPrefetchClient } from '@middy/util'
6
+ import {
7
+ canPrefetch,
8
+ createClient,
9
+ createPrefetchClient,
10
+ catchInvalidSignatureException
11
+ } from '@middy/util'
7
12
 
8
13
  const defaults = {
9
14
  AwsClient: ApiGatewayManagementApiClient,
@@ -37,7 +42,10 @@ const wsResponseMiddleware = (opts) => {
37
42
  client = await createClient(options, request)
38
43
  }
39
44
 
40
- await client.send(new PostToConnectionCommand(response))
45
+ const command = new PostToConnectionCommand(response)
46
+ await client
47
+ .send(command)
48
+ .catch((e) => catchInvalidSignatureException(e, client, command))
41
49
 
42
50
  request.response.statusCode = 200
43
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/ws-response",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "description": "WebSocket response handling middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -60,13 +60,13 @@
60
60
  "url": "https://github.com/sponsors/willfarrell"
61
61
  },
62
62
  "dependencies": {
63
- "@middy/util": "5.2.0"
63
+ "@middy/util": "5.2.1"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@aws-sdk/client-apigatewaymanagementapi": "^3.0.0",
67
- "@middy/core": "5.2.0",
67
+ "@middy/core": "5.2.1",
68
68
  "@types/aws-lambda": "^8.10.97",
69
69
  "aws-xray-sdk": "^3.3.3"
70
70
  },
71
- "gitHead": "2d9096a49cd8fb62359517be96d6c93609df41f0"
71
+ "gitHead": "4d55da221b9165b4b3e59a12632fd40a149a1e92"
72
72
  }