[lsp-server] Ignore 'Content-Length' case

This commit is contained in:
Sebastian Sturm 2023-07-10 22:36:52 +02:00
parent ea02f4cba1
commit 872cd30325

View file

@ -265,7 +265,7 @@ fn read_msg_text(inp: &mut dyn BufRead) -> io::Result<Option<String>> {
let header_name = parts.next().unwrap();
let header_value =
parts.next().ok_or_else(|| invalid_data!("malformed header: {:?}", buf))?;
if header_name == "Content-Length" {
if header_name.eq_ignore_ascii_case("Content-Length") {
size = Some(header_value.parse::<usize>().map_err(invalid_data)?);
}
}