pjfanning opened a new pull request, #822:
URL: https://github.com/apache/pekko-grpc/pull/822

   AbstractGrpcProtocol.scala — Negative frame length validation
   - Added if (length < 0) check in both the strict decoder (line 137) and 
streaming decoder (line 157)
   - Prevents undefined behavior in ByteReader.take() when the high bit of the 
4-byte length field is set
   
   GrpcProtocolWeb.scala — Three gRPC-Web bugs fixed:
   1. Frame type mask: 80 (decimal, 0x50) → 0x80 (hex, 128). The old mask 0x50 
would match trailer frames (0x80) as data frames (0x00 & 0x50 == 0), silently 
swallowing trailers.
   2. Match arm: case 1 → case 0x80. With the corrected mask, trailer frames 
yield 0x80, not 1. The old case never matched.
   3. decodeTrailer: replaced ??? (runtime NotImplementedError) with actual 
parsing of key:value\r\n format back into List[HttpHeader].
   
   GrpcProtocolWebSpec.scala — New test file with 4 tests:
   - Data frame encode/decode roundtrip
   - Trailer frame encode/decode roundtrip
   - Data vs trailer frame discrimination by type bit
   - Negative frame length rejection


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to