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

+6 -2
View File
@@ -17019,9 +17019,13 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req,
std::move(progress), std::move(out),
decompress_)) {
if (error != Error::Canceled) {
// Tell the caller apart from a plain read failure when the body could
// not be decoded because of its Content-Encoding.
// Tell the caller apart from a plain read failure when the body was
// over the payload limit or could not be decoded because of its
// Content-Encoding.
switch (content_status) {
case StatusCode::PayloadTooLarge_413:
error = Error::ExceedMaxPayloadSize;
break;
case StatusCode::UnsupportedMediaType_415:
error = Error::UnsupportedContentEncoding;
break;