diff --git a/src/cargo/util/network/http.rs b/src/cargo/util/network/http.rs index e5e429611f7..73880f60e16 100644 --- a/src/cargo/util/network/http.rs +++ b/src/cargo/util/network/http.rs @@ -152,6 +152,8 @@ pub fn configure_http_handle(config: &Config, handle: &mut Easy) -> CargoResult< _ => return, }; let starts_with_ignore_case = |line: &str, text: &str| -> bool { + let line = line.as_bytes(); + let text = text.as_bytes(); line[..line.len().min(text.len())].eq_ignore_ascii_case(text) }; match str::from_utf8(data) {