fix(shell): preserve proxy env for child tasks

Allow standard proxy environment variables through the child task environment filter, with regression coverage for upper- and lower-case forms.
This commit is contained in:
axobase001
2026-05-14 20:03:12 +08:00
committed by GitHub
parent 5003fd4d38
commit 7d3a36ddbc
+29
View File
@@ -169,6 +169,14 @@ fn is_allowed_parent_env_key(key: &OsStr) -> bool {
| "EXTENSIONSDKDIR"
| "DEVENVDIR"
| "VISUALSTUDIOVERSION"
// Standard proxy variables are needed by shell tasks in
// corporate and WSL environments where direct internet egress is
// blocked. They intentionally exclude token/API-key-shaped vars.
| "HTTP_PROXY"
| "HTTPS_PROXY"
| "NO_PROXY"
| "ALL_PROXY"
| "FTP_PROXY"
) || normalized.starts_with("LC_")
}
@@ -325,6 +333,27 @@ mod tests {
}
}
#[test]
fn child_env_allowlist_includes_proxy_keys_either_case() {
for key in [
"HTTP_PROXY",
"HTTPS_PROXY",
"NO_PROXY",
"ALL_PROXY",
"FTP_PROXY",
"http_proxy",
"https_proxy",
"no_proxy",
"all_proxy",
"ftp_proxy",
] {
assert!(
is_allowed_parent_env_key(OsStr::new(key)),
"child env allowlist should include proxy key {key}"
);
}
}
#[test]
fn mcp_env_allowlist_includes_python_bootstrap_keys() {
for key in [