1
0
mirror of synced 2025-04-26 14:28:51 +03:00

Merge pull request #51 from sgraham/chunk-terminator

Read \r\n terminator after chunked encoding
This commit is contained in:
yhirose 2018-04-16 17:43:12 -04:00 committed by GitHub
commit 4ddd5d9c5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -833,6 +833,12 @@ bool read_content_chunked(Stream& strm, T& x)
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;
}