Fix "blank new line in chunk" bug

If a chunk contains an empty line ("\r\n") chunkLength will be 0 and _setReadyState(readyStateDone) will be called, resulting in truncated payloads. We actually need to wait for "0\r\n" to set state as done.
This commit is contained in:
1618033
2022-11-29 19:19:46 -06:00
committed by GitHub
parent 6fdfafd0c7
commit 887bdef1cd

View File

@ -1448,7 +1448,7 @@ void AsyncHTTPRequest::_processChunks()
size_t chunkLength = strtol(chunkHeader.c_str(), nullptr, 16);
_contentLength += chunkLength;
if (chunkLength == 0)
if (chunkHeader == "0\r\n")
{
char* connectionHdr = respHeaderValue("connection");