Implement body size limit middleware with dynamic config reload
Add body_limit middleware that reads limit from ArcSwap<DynamicConfig> on each request, enabling runtime config changes without restart. Uses Content-Length header check for fast rejection and http_body_util::Limited for streaming body enforcement. Default limit: 100 MB (104,857,600 bytes). Returns 413 Payload Too Large when exceeded.
This commit is contained in:
@@ -31,6 +31,7 @@ clap = { version = "=4.6.1", features = ["derive"] }
|
||||
signal-hook = "=0.3.18"
|
||||
anyhow = "=1.0.102"
|
||||
thiserror = "=2.0.18"
|
||||
http-body-util = "=0.1.3"
|
||||
futures = "=0.3.31"
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
Reference in New Issue
Block a user