Chunked transfer encoding: cached response is truncated
Scope
Cached response is truncated (missing the final CRLF) when chunked transfer encoding is used by backend. This causes client to hang waiting for an incomplete response.
Related issue: #1692
Example
Original response from the WordPress (https://github.com/tempesta-tech/tempesta-test/issues/290) :
142b0\r\n
<!DOCTYPE html>
...
</html>
\r\n
0\r\n
\r\n
and cached response:
142b0\r\n
<!DOCTYPE html>
...
</html>
\r\n
0\r\n
Testing
Test to reproduce:: cache.test_cache.TestChunkedResponse
Now we use another cache strategy. Before placing response into cache, tempesta transform response to regular form, without chunks and adds Content-Length header. It means once "expected chunked" response will be retrieved from the cache it must not contain any chunking information and must contain Content-Length header.
FIxed by PR #1418