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:
@@ -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 [
|
||||
|
||||
Reference in New Issue
Block a user