Skip to main content

validate_user_agent

Function validate_user_agent 

Source
pub fn validate_user_agent(ua: &str) -> AppResult<()>
Expand description

Validate User-Agent: non-empty, length-capped, visible ASCII only (HTTP header).

ยงErrors

Returns crate::error::ErrorKind::Config when empty, over MAX_USER_AGENT_CHARS, or containing control / non-ASCII bytes (would fail HeaderValue::from_str).