Closed vearne closed 3 months ago
[!CAUTION]
Review failed
The pull request is closed.
The recent changes enhance the ParseFrameBase
function in the HTTP/2 implementation by refining how the Payload
field is assigned. Now, if the frame length exceeds the available bytes in the input slice, the function ensures that all available bytes after the header are included in the Payload
, improving robustness and reducing potential out-of-bounds errors.
Files | Change Summary |
---|---|
http2/http2.go | Modified ParseFrameBase to ensure Payload includes all bytes from HeaderSize to the end of the slice if the frame length exceeds available bytes. |
sequenceDiagram
participant Client
participant Server
Client->>Server: Send HTTP/2 Frame
Server->>Server: Parse Frame
alt Payload Length Valid
Server->>Server: Assign Payload from Header
else Payload Length Exceeds
Server->>Server: Assign Payload from HeaderSize to End
end
Server->>Client: Acknowledge Frame Processing
🐰 In the code where bytes do play,
A rabbit hops and says, "Hooray!"
The frames now dance and twirl with glee,
With Payloads safe and error-free.
So let us munch on bytes so fine,
As code and joy together shine! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
Bug Fixes
Performance Enhancements