Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
timzaak committed Jun 24, 2024
1 parent 91f41b1 commit 99030b8
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions server/src/domain_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,19 +536,25 @@ impl DomainStorage {
}
}
pub fn check_if_empty_index(&self, host: &str, path: &str) -> bool {
self.meta
.get(host)
.map(|v| match v.value() {
DomainMeta::OneWeb { .. } => path.is_empty(),
DomainMeta::MultipleWeb(map) => {
if path.len() > 1 {
map.contains_key(&path[1..])
} else {
map.contains_key(path)
match self.meta
.get(host) {
Some(v) => {
match v.value() {
DomainMeta::OneWeb { .. } => path.is_empty(),
DomainMeta::MultipleWeb(map) => {
if path.len() > 1 {
map.contains_key(&path[1..])
} else {
map.contains_key(path)
}
}
}
})
.unwrap_or(false)
},
None => {
debug!("{host} {path} does not exists in meta");
false
}
}
}

pub fn save_file(
Expand Down

0 comments on commit 99030b8

Please sign in to comment.