mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 17:28:29 +00:00
Read \r\n terminator after chunked encoding
This commit is contained in:
parent
0e239a0014
commit
87c673fd67
1 changed files with 6 additions and 0 deletions
|
@ -828,6 +828,12 @@ bool read_content_chunked(Stream& strm, T& x)
|
||||||
chunk_len = std::stoi(reader.ptr(), 0, 16);
|
chunk_len = std::stoi(reader.ptr(), 0, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chunk_len == 0) {
|
||||||
|
// Reader terminator after chunks
|
||||||
|
if (!reader.getline() || strcmp(reader.ptr(), "\r\n"))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue