aboutsummaryrefslogtreecommitdiffstats
path: root/src/args.rs
diff options
context:
space:
mode:
authorDean Li <deantvv@gmail.com>2021-02-21 08:55:17 +0000
committerDean Li <deantvv@gmail.com>2021-02-24 13:33:42 +0000
commitf1c8a55b7a7ae533236564a195037128804445e6 (patch)
tree7c07f0eefb991934c29ebe23789cb4d8a62fc396 /src/args.rs
parentAdd CHANGELOG entries for recent changes (diff)
downloadminiserve-f1c8a55b7a7ae533236564a195037128804445e6.tar.gz
miniserve-f1c8a55b7a7ae533236564a195037128804445e6.zip
Allow set custom headers from CLI
Diffstat (limited to 'src/args.rs')
-rw-r--r--src/args.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/args.rs b/src/args.rs
index f736941..53f1638 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -117,6 +117,10 @@ struct CliArgs {
/// Shown instead of host in page title and heading
#[structopt(short = "t", long = "title")]
title: Option<String>,
+
+ /// Custom header from user
+ #[structopt(long = "header")]
+ header: Option<String>,
}
/// Checks wether an interface is valid, i.e. it can be parsed into an IP address
@@ -225,6 +229,7 @@ pub fn parse_args() -> crate::MiniserveConfig {
zip_enabled: args.enable_zip,
dirs_first: args.dirs_first,
title: args.title,
+ header: args.header,
}
}