mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Auto merge of #8222 - ehuss:redact-http-debug, r=alexcrichton
Try to remove secrets from http.debug. This tries to remove some private data (such as tokens) from the `http.debug` output.
This commit is contained in:
commit
911f0b94e5
@ -556,7 +556,12 @@ pub fn configure_http_handle(config: &Config, handle: &mut Easy) -> CargoResult<
|
||||
};
|
||||
match str::from_utf8(data) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user