Class SizeLimitHandler

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
All Implemented Interfaces:
Handler, Handler.Container, Handler.Singleton, Request.Handler, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle, org.eclipse.jetty.util.thread.Invocable

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.