mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-09-02 23:03:47 +00:00
Document that the multipart part-count cap only applies to the buffered form path
CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT is enforced only in Server::read_content(), where parts are accumulated into req.form. The streaming ContentReader path keeps nothing and was never in scope, but this was undocumented (GHSA-923p-8q8g-xcqj). Note the split in the README and show how to bound the part count from inside a ContentReader handler.
This commit is contained in:
@@ -730,6 +730,12 @@ svr.Post("/content_receiver",
|
||||
});
|
||||
```
|
||||
|
||||
`CPPHTTPLIB_MULTIPART_FORM_DATA_FILE_MAX_COUNT` (default 1024) caps the number of
|
||||
form-data parts only on the buffered path, where every part is accumulated into
|
||||
`req.form`. The content receiver keeps nothing, so the cap does not apply here.
|
||||
If your handler needs an upper bound on the number of parts, count them yourself
|
||||
and return `false` from the callback to stop the parser.
|
||||
|
||||
### Send content with the content provider
|
||||
|
||||
```cpp
|
||||
|
||||
Reference in New Issue
Block a user