Fix #321: LF header line ending

This commit is contained in:
Nicolas
2021-02-15 17:58:04 -03:00
committed by Martin Algesten
parent e411a629bd
commit a73ff2e465

View File

@@ -537,14 +537,16 @@ fn read_next_line(reader: &mut impl BufRead) -> io::Result<String> {
));
}
if !s.ends_with("\r\n") {
if !s.ends_with("\n") {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
format!("Header field didn't end with \\r: {}", s),
format!("Header field didn't end with \\n: {}", s),
));
}
s.pop();
if s.ends_with("\r") {
s.pop();
}
Ok(s)
}