mirror of
https://github.com/lexmount/moli.git
synced 2026-09-24 16:01:31 +00:00
Add private network blocking env flag
This commit is contained in:
+1
-1
@@ -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)]
|
||||
|
||||
+9
-1
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user