Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

Add private network blocking env flag

ldm0fa2d3f00d5df
diff --git a/moli/src/cli.rs b/moli/src/cli.rs
index e2519ad20..ed146f3d0 100644
--- a/moli/src/cli.rs
+++ b/moli/src/cli.rs
@@ -337,7 +337,7 @@ pub struct CommonArgs {
#[arg(long)]
pub document_start_script_file: Vec<String>,
- #[arg(long)]
+ #[arg(long, env = "MOLI_BLOCK_PRIVATE_NETWORKS")]
pub block_private_networks: bool,
#[arg(long)]
diff --git a/moli/tests/cli.rs b/moli/tests/cli.rs
index 808345a82..2f97205c4 100644
--- a/moli/tests/cli.rs
+++ b/moli/tests/cli.rs
@@ -997,6 +997,7 @@ fn env_flags_are_fallbacks_and_cli_flags_take_priority() {
.env("MOLI_TEST_ENV_FLAG_CASE", case)
.env("MOLI_LAYOUT", layout)
.env("MOLI_RESOURCE", resource)
+ .env("MOLI_BLOCK_PRIVATE_NETWORKS", resource)
.output()
.unwrap();
@@ -1016,7 +1017,13 @@ fn parse_env_flags_in_child_process() {
};
let args = if case == "cli-overrides-env" {
- vec!["moli", "serve", "--layout", "--resource"]
+ vec![
+ "moli",
+ "serve",
+ "--layout",
+ "--resource",
+ "--block-private-networks",
+ ]
} else {
vec!["moli", "serve"]
};
@@ -1028,6 +1035,7 @@ fn parse_env_flags_in_child_process() {
assert_eq!(args.common.layout, expected);
assert_eq!(args.common.resource, expected);
+ assert_eq!(args.common.block_private_networks, expected);
}
#[test]