only print incoming requests in debug mode

This commit is contained in:
Joseph Montanaro 2022-12-28 08:54:08 -08:00
parent df6b362a31
commit 4956b64371

View File

@ -88,7 +88,11 @@ impl Handler {
if n >= 4 && &buf[(n - 4)..n] == b"\r\n\r\n" {break;}
if n == buf.len() {return Err(RequestError::RequestTooLarge);}
}
println!("{}", std::str::from_utf8(&buf).unwrap());
if cfg!(debug_assertions) {
println!("{}", std::str::from_utf8(&buf).unwrap());
}
Ok(buf)
}