* Fix #2339

* Fix CI errors

* Fix Windows build error

* Fix CI errors on Windows

* Fix payload_max_length initialization in BodyReader

* Initialize payload_max_length with CPPHTTPLIB_PAYLOAD_MAX_LENGTH in BodyReader

* Update README and tests to clarify payload_max_length behavior and add no limit case

* Fix server thread lambda capture in ClientVulnerabilityTest
This commit is contained in:
yhirose
2026-02-06 19:30:33 -10:00
committed by GitHub
parent 5ead179b8e
commit 4639b696ab
3 changed files with 463 additions and 46 deletions

View File

@@ -958,6 +958,12 @@ cli.set_write_timeout(5, 0); // 5 seconds
cli.set_max_timeout(5000); // 5 seconds
```
### Set maximum payload length for reading a response body
```c++
cli.set_payload_max_length(1024 * 1024 * 512); // 512MB
```
### Receive content with a content receiver
```c++
@@ -1158,6 +1164,11 @@ httplib::Server svr;
svr.listen("127.0.0.1", 8080);
```
Payload Limit
-------------
The maximum payload body size is limited to 100MB by default for both server and client. You can change it with `set_payload_max_length()` or by defining `CPPHTTPLIB_PAYLOAD_MAX_LENGTH` at compile time. Setting it to `0` disables the limit entirely.
Compression
-----------