Skip to content

Commit

Permalink
Hook up ERR_INVALID_CLOSE_PAYLOAD
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB authored and Alex Hultman committed Jun 19, 2024
1 parent 01058d9 commit 0d43460
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/WebSocketProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0d43460

Please sign in to comment.