Auto merge of #15257 - sebastiansturm:master, r=lnicola

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

this is a trivial PR meant to address issue #15197: the 'Content-Length' header field should probably be treated as case-insensitive
This commit is contained in:
bors 2023-07-11 05:35:46 +00:00
commit cabe26c228

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)?);
}
}