pub struct ValidationCfg {
pub max_body: String,
pub max_response_body: String,
pub upstream_timeout: String,
pub max_header_bytes: String,
pub allow_methods: Vec<String>,
pub stream_passthrough: bool,
}Fields§
§max_body: Stringe.g. “2MiB”. Requests with a larger body are rejected with 413.
max_response_body: StringCap on the upstream response body EdgeGuard buffers, e.g. “16MiB”. “0” disables the cap (unbounded). Protects against an upstream OOM-ing the proxy; raise it if you proxy large downloads.
upstream_timeout: StringMax time to wait for the upstream response and to read its body, e.g. “30s”, “500ms”, “2m”. “0” disables the timeout. Bounds a stalled upstream so it can’t pin a handler task indefinitely; on elapse the proxy returns 504.
max_header_bytes: StringCap on the total size of incoming request headers (sum of name + value bytes), e.g.
“32KiB”. “0” disables the cap (default). Requests over the limit get 431. This is a
policy limit enforced by EdgeGuard on top of hyper’s own transport-level header cap.
allow_methods: Vec<String>Allowed HTTP methods; empty list means allow all.
stream_passthrough: boolStream (don’t buffer) responses whose Content-Type is text/event-stream. Off by
default: the proxy normally buffers the whole upstream body so it can cap size
(max_response_body) and account exact egress bytes. That buffering defeats Server-Sent
Events / chunked streaming — the client only sees the body once the upstream finishes.
Turn this on to forward SSE responses frame-by-frame as they arrive (preserving
time-to-first-byte). When a response is streamed this way the max_response_body cap and
the body-read deadline don’t apply (the connect/first-byte upstream_timeout still
does); egress bytes are tallied as frames flow. Non-SSE responses are unaffected.
Trait Implementations§
Source§impl Clone for ValidationCfg
impl Clone for ValidationCfg
Source§fn clone(&self) -> ValidationCfg
fn clone(&self) -> ValidationCfg
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more