Skip to content

Commit

Permalink
[server] Fix potential mem leak
Browse files Browse the repository at this point in the history
  • Loading branch information
geropl authored and roboquat committed Dec 8, 2021
1 parent c2ce94f commit baa41ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/server/src/express/ws-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ export class WsExpressHandler {
perMessageDeflate: {
// don't compress if a message is less than 256kb
threshold: 256 * 1024
}
},
// we don't use this feature, so avoid having another potential mem leak
clientTracking: false,
});
this.wss.on('error', (err) => {
log.error('Websocket error', err, { ws: this.wss });
})
});
}

ws(route: Route, handler: (ws: websocket, request: express.Request) => void, ...handlers: WsHandler[]): void {
Expand Down

0 comments on commit baa41ec

Please sign in to comment.