From 0d4346037fa2b933132b23b8f2cfc8a1bfddf69f Mon Sep 17 00:00:00 2001 From: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:55:54 +0200 Subject: [PATCH] Hook up ERR_INVALID_CLOSE_PAYLOAD --- src/WebSocketProtocol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebSocketProtocol.h b/src/WebSocketProtocol.h index a1f4ca19b..085fbd31d 100644 --- a/src/WebSocketProtocol.h +++ b/src/WebSocketProtocol.h @@ -170,7 +170,7 @@ static inline CloseFrame parseClosePayload(char *src, size_t length) { if (cf.code < 1000 || cf.code > 4999 || (cf.code > 1011 && cf.code < 4000) || (cf.code >= 1004 && cf.code <= 1006) || !isValidUtf8((unsigned char *) cf.message, cf.length)) { /* Even though we got a WebSocket close frame, it in itself is abnormal */ - return {1006, nullptr, 0}; + return {1006, (char *) ERR_INVALID_CLOSE_PAYLOAD.data(), ERR_INVALID_CLOSE_PAYLOAD.length()}; } } return cf;