mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 00:59:02 +03:00
fix: escape path-prefix/url-prefix different
This commit is contained in:
@@ -143,7 +143,7 @@ impl Args {
|
||||
let uri_prefix = if path_prefix.is_empty() {
|
||||
"/".to_owned()
|
||||
} else {
|
||||
format!("/{}/", encode_uri(&path_prefix))
|
||||
format!("/{}/", &path_prefix)
|
||||
};
|
||||
let cors = matches.is_present("cors");
|
||||
let auth = match matches.value_of("auth") {
|
||||
@@ -237,8 +237,3 @@ pub fn load_private_key(filename: &str) -> BoxResult<PrivateKey> {
|
||||
}
|
||||
Ok(PrivateKey(keys[0].to_owned()))
|
||||
}
|
||||
|
||||
pub fn encode_uri(v: &str) -> String {
|
||||
let parts: Vec<_> = v.split('/').map(urlencoding::encode).collect();
|
||||
parts.join("/")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user