pub struct HttpConfig {
pub timeout: Option<u64>,
pub body_limit: Option<String>,
pub compression: bool,
pub catch_panic: bool,
pub trailing_slash: TrailingSlash,
pub maintenance: bool,
pub maintenance_message: Option<String>,
pub sensitive_headers: bool,
}Expand description
HTTP-level middleware settings, configurable under server.http in YAML.
Fields§
§timeout: Option<u64>Request timeout in seconds. None disables the timeout.
body_limit: Option<String>Maximum request body size (e.g. "2mb", "512kb"). None means unlimited.
compression: boolEnable response compression via CompressionLayer.
catch_panic: boolEnable the catch-panic middleware (converts panics into 500 responses).
trailing_slash: TrailingSlashHow to handle trailing slashes in request paths.
maintenance: boolEnable maintenance mode (returns 503 for all requests).
maintenance_message: Option<String>Optional custom message returned in maintenance mode responses.
sensitive_headers: boolRedact Authorization, Cookie, Set-Cookie, and Proxy-Authorization headers from logs.
Trait Implementations§
Source§impl Clone for HttpConfig
impl Clone for HttpConfig
Source§fn clone(&self) -> HttpConfig
fn clone(&self) -> HttpConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpConfig
impl Debug for HttpConfig
Source§impl Default for HttpConfig
impl Default for HttpConfig
Source§impl<'de> Deserialize<'de> for HttpConfigwhere
HttpConfig: Default,
impl<'de> Deserialize<'de> for HttpConfigwhere
HttpConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HttpConfig
impl RefUnwindSafe for HttpConfig
impl Send for HttpConfig
impl Sync for HttpConfig
impl Unpin for HttpConfig
impl UnsafeUnpin for HttpConfig
impl UnwindSafe for HttpConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more