Payload Limit Plugin
The Payload Limit plugin protects your backends from “Denial of Service” attacks that attempt to saturate your resources by sending excessively large request bodies.
⚙️ Configuration
The plugin is typically enabled for routes that accept user-uploaded data.
- urn: "urn:crate:plugin:payload-limit"
name: "limit-uploads"
type: "request_filter"
active: true
config:
max_bytes: 10485760 # 10MB
Field Definitions
| Field | Type | Description |
|---|---|---|
max_bytes |
int | The maximum allowed size of the request body in bytes. |
[!NOTE] If a request exceeds this limit, Crate will instantly reject it with a
413 Request Entity Too Largeerror.
🚀 Examples
1. Limit Single File Uploads
config:
max_bytes: 5242880 # 5MB
2. Strict API Limit
config:
max_bytes: 102400 # 100KB