Report a response body over the limit as ExceedMaxPayloadSize

A buffered request whose response body went over set_payload_max_length(),
also once decompressed, failed with Error::Read, while the Stream API
reports the same limit as Error::ExceedMaxPayloadSize. read_content()
already marks it with a 413 status, so map that status to
ExceedMaxPayloadSize next to the 415 and 500 the client maps already.
This commit is contained in:
yhirose committed 2026-10-18 18:40:23 -04:00
1 parent 344aceb446
commit d99c697be6
5 files changed
+43 -2

No files matched your search

+2
View File
@@ -1268,6 +1268,8 @@ cli.set_max_timeout(std::chrono::seconds(5));
cli.set_payload_max_length(1024 * 1024 * 512); // 512MB
```
A response body over the limit, also once decompressed, fails the request with `Error::ExceedMaxPayloadSize`.
### Receive content with a content receiver
```c++