Fixed bug where usrdir could be false but still pass

This commit is contained in:
int 80h
2020-05-20 12:22:24 -04:00
parent c27688d7d7
commit e80abd0553

View File

@@ -179,7 +179,7 @@ async fn handle_connection(
let mut path = PathBuf::new();
if url.path().starts_with("/~") && srv.server.usrdir.is_some() {
if url.path().starts_with("/~") && srv.server.usrdir.unwrap_or(false) {
let usr = url.path().trim_start_matches("/~");
let usr: Vec<&str> = usr.splitn(2, "/").collect();
path.push("/home/");