diff --git a/crates/domistream/src/rtsp/mod.rs b/crates/domistream/src/rtsp/mod.rs index 81e59aa..241bd29 100644 --- a/crates/domistream/src/rtsp/mod.rs +++ b/crates/domistream/src/rtsp/mod.rs @@ -287,10 +287,10 @@ impl RtspFramer { let mut headers = Vec::new(); for raw in head.split(|&b| b == b'\n').skip(1) { let text = core::str::from_utf8(raw.strip_suffix(b"\r").unwrap_or(raw)).unwrap_or(""); - if let Some((n, v)) = text.split_once(':') { - if n.eq_ignore_ascii_case("content-length") { - headers.push((n.to_owned(), v.trim_matches([' ', '\t']).to_owned())); - } + if let Some((n, v)) = text.split_once(':') + && n.eq_ignore_ascii_case("content-length") + { + headers.push((n.to_owned(), v.trim_matches([' ', '\t']).to_owned())); } } Ok(Some((head_len, content_length(&headers, head_len)?)))