pub fn parse_request<R: BufRead>(
reader: &mut R,
limits: &Limits,
) -> Result<Option<Incoming>>Expand description
Parse a single request off a buffered stream, enforcing limits. Returns
Ok(None) if the peer closed before sending anything, or
Ok(Some(Incoming::TooLarge)) if headers/body exceed the limits (so the
server can reply 413 without allocating an attacker-chosen buffer).