Skip to content

Commit

Permalink
Try to remove secrets from http.debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed May 8, 2020
1 parent c719a05 commit b3616c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cargo/ops/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit b3616c0

Please sign in to comment.