You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
603 B

//! Settings for web server
//!
//! Usually derived from config
use super::*;
const DEFAULT_MAX_BODY_LEN_ARESP: u64 = 1024 * 4; // 4KB
const DEFAULT_MAX_BODY_LEN: u64 = 1024 * 1024 * 4; // 4MB
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Settings
{
/// First is max body len for auth responses, 2nd is for data.
pub max_body_len: (u64, u64),
pub trust_x_forwarded_for: bool,
}
impl Default for Settings
{
#[inline]
fn default() -> Self
{
Self {
max_body_len: (DEFAULT_MAX_BODY_LEN_ARESP, DEFAULT_MAX_BODY_LEN),
trust_x_forwarded_for: false,
}
}
}