Class LimitInterceptor
java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.LimitInterceptor
- All Implemented Interfaces:
Interceptor
- Description
- Limits the maximum length of a HTTP message body.
- Explanation
Note that due to the streaming nature of Membrane, a request header may already have been passed on to the backend, when the condition "body.length > X" becomes true. In this case, further processing is aborted and the connection to the backend is simply closed.
To apply <limit/> only to either requests or responses, wrap it in a corresponding tag: <request><limit ... /></request>.
- Topic
- 6. Security
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.predic8.membrane.core.interceptor.Interceptor
Interceptor.Flow -
Field Summary
Fields inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
name, router -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonghandleRequest(Exchange exc) handleResponse(Exchange exc) voidsetMaxBodyLength(long maxBodyLength) Methods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
getDisplayName, getFlow, getHelpId, getLongDescription, getMessage, getRouter, getRule, handleAbort, init, init, setDisplayName, setFlow
-
Constructor Details
-
LimitInterceptor
public LimitInterceptor()
-
-
Method Details
-
handleRequest
- Specified by:
handleRequestin interfaceInterceptor- Overrides:
handleRequestin classAbstractInterceptor- Throws:
Exception
-
handleResponse
- Specified by:
handleResponsein interfaceInterceptor- Overrides:
handleResponsein classAbstractInterceptor- Throws:
Exception
-
getShortDescription
- Specified by:
getShortDescriptionin interfaceInterceptor- Overrides:
getShortDescriptionin classAbstractInterceptor
-
getMaxBodyLength
public long getMaxBodyLength() -
setMaxBodyLength
public void setMaxBodyLength(long maxBodyLength) - Description
- The maximal length of a message body.
- Example
- 10485760
-