Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix InputStream caching in ContentCachingReqWrapper
Prior to this commit, the ContentCachingRequestWrapper would immediately consume the wrapped request's InputStream when asked for the cached content; that caused several issues: * the request body was read in memory even if it wasn't yet consumed by the application, leading to inefficiencies. * when requesting the InputStream, an empty InputStream was returned since the original was already read. This case only happened for form POSTs requests. This commit makes sure that the wrapper does not alter the request expected behavior: * when getting the inputstream, it is wrapped in order to cache its content * when getting request parameters, the request body is cached and its inputstream is consumed, as expected Issue: SPR-12810
- Loading branch information
Showing
2 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters