You duplicate the input stream but not its content. As @John posted, you can use a ContentCachingRequestWrapper
. I combined it to a component extending OncePerRequestFilter
and a storage with @RequestScope
to retrieve it in any service. This leads to a lighter solution, given in https://stackoverflow.com/a/79633806/7251133.