Skip to main content

rws_http/
early_hints.rs

1//! `103 Early Hints` links: what a usable `Link` value is. The middleware
2//! that sends them is rust-web-server's `early_hints`.
3
4/// A usable `Link` value: not empty, no CR, LF or NUL.
5pub fn valid(link: &str) -> bool {
6    !link.trim().is_empty() && !link.bytes().any(|b| matches!(b, b'\r' | b'\n' | 0))
7}