Describe the bug
In harTracer.ts, the WebSocket frame header size calculation uses length > 2 ** 16 to determine when to use the 64-bit extended payload length field. Per RFC 6455 Section 5.2, a 16-bit unsigned integer can represent values 0–65535, so a payload of exactly 65536 (2 ** 16) bytes cannot fit in 16 bits and requires the 64-bit extended length field (8 additional bytes). The current condition misses this boundary, causing response._transferSize to be 6 bytes too small for payloads of exactly 65536 bytes.
Steps to reproduce
Record HAR for a WebSocket connection that receives a frame with exactly 65536 bytes of payload data. The reported response._transferSize will be 6 bytes less than the actual on-wire size.
Expected behavior
The condition should be length >= 2 ** 16 instead of length > 2 ** 16.
Introduced in
Commit 426cc4e ("feat(har): calculate request.headerSize, response.headerSize, and response._transferSize for WebSocket")
Describe the bug
In
harTracer.ts, the WebSocket frame header size calculation useslength > 2 ** 16to determine when to use the 64-bit extended payload length field. Per RFC 6455 Section 5.2, a 16-bit unsigned integer can represent values 0–65535, so a payload of exactly 65536 (2 ** 16) bytes cannot fit in 16 bits and requires the 64-bit extended length field (8 additional bytes). The current condition misses this boundary, causingresponse._transferSizeto be 6 bytes too small for payloads of exactly 65536 bytes.Steps to reproduce
Record HAR for a WebSocket connection that receives a frame with exactly 65536 bytes of payload data. The reported
response._transferSizewill be 6 bytes less than the actual on-wire size.Expected behavior
The condition should be
length >= 2 ** 16instead oflength > 2 ** 16.Introduced in
Commit 426cc4e ("feat(har): calculate
request.headerSize,response.headerSize, andresponse._transferSizeforWebSocket")