mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Try to remove secrets from http.debug.
This commit is contained in:
parent
c719a05a81
commit
b3616c08a4
@ -556,7 +556,12 @@ pub fn configure_http_handle(config: &Config, handle: &mut Easy) -> CargoResult<
|
|||||||
};
|
};
|
||||||
match str::from_utf8(data) {
|
match str::from_utf8(data) {
|
||||||
Ok(s) => {
|
Ok(s) => {
|
||||||
for line in s.lines() {
|
for mut line in s.lines() {
|
||||||
|
if line.starts_with("Authorization:") {
|
||||||
|
line = "Authorization: [REDACTED]";
|
||||||
|
} else if line[..line.len().min(10)].eq_ignore_ascii_case("set-cookie") {
|
||||||
|
line = "set-cookie: [REDACTED]";
|
||||||
|
}
|
||||||
log!(level, "http-debug: {} {}", prefix, line);
|
log!(level, "http-debug: {} {}", prefix, line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user