Package org.apache.tika.server.core
Class MaxRequestSizeFilter
java.lang.Object
org.apache.tika.server.core.MaxRequestSizeFilter
- All Implemented Interfaces:
jakarta.ws.rs.container.ContainerRequestFilter
@Provider
public class MaxRequestSizeFilter
extends Object
implements jakarta.ws.rs.container.ContainerRequestFilter
Rejects request bodies larger than
maxRequestSizeBytes.
A declared Content-Length over the limit is refused before the body is read. Requests without a usable Content-Length -- chunked transfer encoding, in particular -- are counted as they are consumed, so the limit holds whether or not the client is honest about the size.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classUnchecked so it crosses whatever read path consumes the entity stream;MaxRequestSizeFilter.RequestTooLargeExceptionMapperturns it into the same 413 the declared-Content-Length rejection produces.static final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfilter(jakarta.ws.rs.container.ContainerRequestContext requestContext)
-
Constructor Details
-
MaxRequestSizeFilter
public MaxRequestSizeFilter(long maxRequestSizeBytes) - Parameters:
maxRequestSizeBytes- maximum request body in bytes; negative disables the limit
-
-
Method Details
-
filter
public void filter(jakarta.ws.rs.container.ContainerRequestContext requestContext) - Specified by:
filterin interfacejakarta.ws.rs.container.ContainerRequestFilter
-