Skip to content

Commit

Permalink
fix: ws onDisconnect handler removed
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Sep 16, 2024
1 parent 0a3eb43 commit a613ef3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/http/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export default class HttpServer {
return this.#method( "trace", location, callback );
}

ws ( location, { onUpgrade, onConnect, onDisconnect, createConnection, maxPayloadLength, idleTimeout, sendPingsAutomatically, compress, compression, maxBackpressure } = {} ) {
ws ( location, { onUpgrade, onConnect, createConnection, maxPayloadLength, idleTimeout, sendPingsAutomatically, compress, compression, maxBackpressure } = {} ) {
maxPayloadLength ??= DEFAULT_WEBSOCKET_MAX_PAYLOAD_LENGTH;

// seconds, 0 - don't disconnect on timeout
Expand Down Expand Up @@ -318,8 +318,6 @@ export default class HttpServer {
const res = result( [ status, Buffer.from( statusText ).toString() ] );

ws.connection._onDisconnect( res );

if ( onDisconnect ) onDisconnect( ws.connection, res );
};

// message
Expand Down

0 comments on commit a613ef3

Please sign in to comment.