Class PayloadSizeLimitingHttpRequesterFilter

java.lang.Object
io.servicetalk.http.utils.PayloadSizeLimitingHttpRequesterFilter
All Implemented Interfaces:
HttpExecutionStrategyInfluencer, StreamingHttpClientFilterFactory, StreamingHttpConnectionFilterFactory, ExecutionStrategyInfluencer<HttpExecutionStrategy>

public final class PayloadSizeLimitingHttpRequesterFilter extends Object implements StreamingHttpClientFilterFactory, StreamingHttpConnectionFilterFactory
Limits the response payload size. The filter will throw an exception which may result in stream/connection closure. A PayloadTooLargeException will be thrown when the maximum payload size is exceeded. The Content-Length response header (when present) is inspected before the body is read so oversized responses that declare their size fail early; otherwise the streaming body is bounded as bytes arrive.

This is independent of the client's default maxAggregatedPayloadSize limit, which bounds the fully-decoded payload at aggregation time. This filter bounds bytes at its position in the chain (so it can run before a decompressor to reject oversized wire bodies early); both limits apply.