mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 09:09:03 +03:00
feat: implement more webdav methods (#13)
Now you can mount the server as webdav driver on windows.
This commit is contained in:
12
src/args.rs
12
src/args.rs
@@ -113,7 +113,8 @@ pub struct Args {
|
||||
pub address: String,
|
||||
pub port: u16,
|
||||
pub path: PathBuf,
|
||||
pub path_prefix: Option<String>,
|
||||
pub path_prefix: String,
|
||||
pub uri_prefix: String,
|
||||
pub auth: Option<String>,
|
||||
pub no_auth_access: bool,
|
||||
pub allow_upload: bool,
|
||||
@@ -136,7 +137,13 @@ impl Args {
|
||||
let path = Args::parse_path(matches.value_of_os("path").unwrap_or_default())?;
|
||||
let path_prefix = matches
|
||||
.value_of("path-prefix")
|
||||
.map(|v| v.trim_matches('/').to_owned());
|
||||
.map(|v| v.trim_matches('/').to_owned())
|
||||
.unwrap_or_default();
|
||||
let uri_prefix = if path_prefix.is_empty() {
|
||||
"/".to_owned()
|
||||
} else {
|
||||
format!("/{}/", &path_prefix)
|
||||
};
|
||||
let cors = matches.is_present("cors");
|
||||
let auth = matches.value_of("auth").map(|v| v.to_owned());
|
||||
let no_auth_access = matches.is_present("no-auth-access");
|
||||
@@ -159,6 +166,7 @@ impl Args {
|
||||
port,
|
||||
path,
|
||||
path_prefix,
|
||||
uri_prefix,
|
||||
auth,
|
||||
no_auth_access,
|
||||
cors,
|
||||
|
||||
Reference in New Issue
Block a user