apple / servicetalk

A networking framework that evolves with your application
https://docs.servicetalk.io
Apache License 2.0
915 stars 180 forks source link

Allow to configure the maxChunkSize for H1 chunk decoding #3049

Closed daschl closed 1 month ago

daschl commented 1 month ago

Before this change it was not possible to configure a maxChunkSize when decoding a HTTP chunked encoding payload. With this change, it defaults to ~8k which is also the default in netty, and aligns its implementation with the netty decoder on how the maxChunkSize is applied.

Tests have been added on both request and response decoding to make sure that even if the maxChunkSize is smaller than the arriving chunk, the code will continue to work. It is expected that there is no user impact, since it will just keep on decoding small chunks until the full payload has been read.