Turn match in restriction config into a list
This commit is contained in:
parent
1e07eb7b2a
commit
368f6657fd
5 changed files with 105 additions and 39 deletions
|
@ -319,13 +319,11 @@ fn validate_tunnel<'a>(
|
|||
restrictions: &'a RestrictionsRules,
|
||||
) -> Result<&'a RestrictionConfig, Response<String>> {
|
||||
for restriction in &restrictions.restrictions {
|
||||
match &restriction.r#match {
|
||||
MatchConfig::Any => {}
|
||||
MatchConfig::PathPrefix(path) => {
|
||||
if !path.is_match(path_prefix) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if !restriction.r#match.iter().all(|m| match m {
|
||||
MatchConfig::Any => true,
|
||||
MatchConfig::PathPrefix(path) => path.is_match(path_prefix),
|
||||
}) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for allow in &restriction.allow {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue