Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Add wildcard in the middle test coverage (#15813)

evawong-oai0bd34c28c768
diff --git a/codex-rs/network-proxy/src/policy.rs b/codex-rs/network-proxy/src/policy.rs
index c586ee9c11..40e71caf36 100644
--- a/codex-rs/network-proxy/src/policy.rs
+++ b/codex-rs/network-proxy/src/policy.rs
@@ -367,6 +367,16 @@ mod tests {
assert_eq!(false, set.is_match("example.com"));
}
+ #[test]
+ fn compile_globset_supports_mid_label_wildcards() {
+ let set = compile_denylist_globset(&["region*.v2.argotunnel.com".to_string()]).unwrap();
+
+ assert_eq!(true, set.is_match("region1.v2.argotunnel.com"));
+ assert_eq!(true, set.is_match("region.v2.argotunnel.com"));
+ assert_eq!(false, set.is_match("xregion1.v2.argotunnel.com"));
+ assert_eq!(false, set.is_match("foo.region1.v2.argotunnel.com"));
+ }
+
#[test]
fn compile_globset_normalizes_apex_and_subdomains() {
let set = compile_denylist_globset(&["**.Example.COM.".to_string()]).unwrap();