Skip to content

Commit

Permalink
fix: prevent client responses on $disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
cnuss committed Nov 26, 2021
1 parent 33752ad commit ceda78b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/events/websocket/WebSocketClients.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export default class WebSocketClients {
const { body } = await lambdaFunction.runHandler()
if (
body &&
routeKey !== '$disconnect' &&
route.definition.routeResponseSelectionExpression === '$default'
) {
// https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-route-response-selection-expressions
Expand Down

0 comments on commit ceda78b

Please sign in to comment.