Hi Tomcat community,

I have a requirement where we want to manually decode a Chunked Transfer
Encoding (CTE) stream using CoyoteInputStream to have access to the chunk
size. This means I want to use CoyoteInputStream.read method and get the
whole CTE bytes. Saying it in another way: we want to decode the CTE at
hand skipping Tomcat defaults.

The current flow from the point of view of CoyoteInputStream is:
CoyoteInputStream.read -> Request.read -> ChunkedInputFilter.read.

ChunkedInputFilter handles the CTE decoding and the read method only
returns the chunks, with no other information, like chunk size.

I found that the method Request.setInputBuffer might allow to set a
different InputBuffer implementation, for instance, the
IdentityInputFilter, which I understand returns all the stream bytes, with
no decoding. However, not sure if this is the right way and which
consequences might have.

I would like to know if there are other ways to override the CTE behavior,
any help would be appreciated.

BTW: We are using Spring Boot with Tomcat embedded.

--
Daniel Andrés Pelaez López

Reply via email to