Last active: 2 years ago
/// Read http request to string.
pub fn read_request(reader: &mut BufReader<&mut &TcpStream>) -> Result<String> {
let mut request_string = String::new();
loop {
let byte = reader.read_line(&mut request_string)?;
if byte < 3 {
break;
}
}
Ok(request_string)
}