limit
Can be used in
proxy, serviceProxy, soapProxy, transport, beans
The limit interceptor can be used to limit the maximal body length a request may have.
Syntax
<limit maxBodyLength="integer" />
Samples
The following example shows how to use the limit interceptor.
<serviceProxy port="8080"> <limit maxBodyLength="52428800" /> <target host="www.predic8.com" /> </serviceProxy>
In this setup, all requests are forwarded to www.predic8.com. Requests larger than 50MB will be discarded.
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>.
Attributes
Name | Mandatory | Description | Example |
---|---|---|---|
maxBodyLength | no | The maximal length of a message body. | 10485760 |
Flow
This interceptor is by default applied to both requests and responses. By wrapping it in an <request>...</request> (or <response>...</response>) element, you can select to apply it only to requests (or only to responses). See request and response.