Class SizeLimitHandler

java.lang.Object
All Implemented Interfaces:
Handler, Handler.Container, Handler.Singleton, Request.Handler, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle, Invocable
Direct Known Subclasses:
SizeLimitHandler

public class SizeLimitHandler extends Handler.Wrapper

A Handler that can limit the size of message bodies in requests and responses.

The optional request and response limits are imposed by checking the Content-Length header or observing the actual bytes seen by this Handler.

Handler order is important; for example, if this handler is before the GzipHandler, then it will limit compressed sizes, if it as after the GzipHandler then it will limit uncompressed sizes.

If a size limit is exceeded then BadMessageException is thrown with a HttpStatus.PAYLOAD_TOO_LARGE_413 status.