mirror of
https://github.com/khoih-prog/AsyncHTTPRequest_Generic.git
synced 2025-07-30 10:27:15 +02:00
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:
@ -1448,7 +1448,7 @@ void AsyncHTTPRequest::_processChunks()
|
|||||||
size_t chunkLength = strtol(chunkHeader.c_str(), nullptr, 16);
|
size_t chunkLength = strtol(chunkHeader.c_str(), nullptr, 16);
|
||||||
_contentLength += chunkLength;
|
_contentLength += chunkLength;
|
||||||
|
|
||||||
if (chunkLength == 0)
|
if (chunkHeader == "0\r\n")
|
||||||
{
|
{
|
||||||
char* connectionHdr = respHeaderValue("connection");
|
char* connectionHdr = respHeaderValue("connection");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user