Skip to content

Commit

Permalink
refactor: use common CloseCode
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Oct 27, 2021
1 parent a22c00f commit 62d0b3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/use/fastify-websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function makeHandler<
socket.once('close', (code, reason) => {
if (pongWait) clearTimeout(pongWait);
if (pingInterval) clearInterval(pingInterval);
if (!isProd && code === 4406)
if (!isProd && code === CloseCode.SubprotocolNotAcceptable)
console.warn(
`WebSocket protocol error occured. It was most likely caused due to an ` +
`unsupported subprotocol "${socket.protocol}" requested by the client. ` +
Expand Down
2 changes: 1 addition & 1 deletion src/use/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export function useServer<
socket.once('close', (code, reason) => {
if (pongWait) clearTimeout(pongWait);
if (pingInterval) clearInterval(pingInterval);
if (!isProd && code === 4406)
if (!isProd && code === CloseCode.SubprotocolNotAcceptable)
console.warn(
`WebSocket protocol error occured. It was most likely caused due to an ` +
`unsupported subprotocol "${socket.protocol}" requested by the client. ` +
Expand Down

0 comments on commit 62d0b3d

Please sign in to comment.