Skip to content

Commit 8bca409

Browse files
authored
fix(websocket): use minimal payload length encoding at the boundaries (#2315)
1 parent e81fee1 commit 8bca409

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/modules/http/server/web_socket/web_socket_response.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace http
4343

4444
size_t length = (data == nullptr) ? 0LL : data->GetLength();
4545

46-
if (length < 0x7D)
46+
if (length <= 0x7D)
4747
{
4848
// frame-payload-length = ( %x00-7D )
4949
// / ( %x7E frame-payload-length-16 )
@@ -52,7 +52,7 @@ namespace http
5252
// ; respectively
5353
header.payload_length = static_cast<uint8_t>(length);
5454
}
55-
else if (length < 0xFFFF)
55+
else if (length <= 0xFFFF)
5656
{
5757
// frame-payload-length-16 = %x0000-FFFF ; 16 bits in length
5858
header.payload_length = 126;

0 commit comments

Comments
 (0)