Skip to content

Commit 4b7fd2c

Browse files
koxu1996weihanglo
andauthored
Update src/cargo/util/network/http.rs
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
1 parent 85c0108 commit 4b7fd2c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/cargo/util/network/http.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,7 @@ pub fn configure_http_handle(gctx: &GlobalContext, handle: &mut Easy) -> CargoRe
6262
handle.cainfo(&cainfo)?;
6363
}
6464
// Use `proxy_cainfo` if explicitly set; otherwise, fall back to `cainfo` as curl does #15376.
65-
let effective_proxy_cainfo = match (&http.proxy_cainfo, &http.cainfo) {
66-
(Some(p), _) => Some(p),
67-
(None, Some(ca)) => Some(ca),
68-
_ => None,
69-
};
70-
if let Some(proxy_cainfo) = effective_proxy_cainfo {
65+
if let Some(proxy_cainfo) = http.proxy_cainfo.as_ref().or(http.cainfo.as_ref()) {
7166
let proxy_cainfo = proxy_cainfo.resolve_path(gctx);
7267
handle.proxy_cainfo(&format!("{}", proxy_cainfo.display()))?;
7368
}

0 commit comments

Comments
 (0)