(pattern: &[&str], host: &[&str])
| 1480 | } |
| 1481 | |
| 1482 | fn host_pattern_labels_match(pattern: &[&str], host: &[&str]) -> bool { |
| 1483 | match pattern.split_first() { |
| 1484 | None => host.is_empty(), |
| 1485 | Some((label, rest)) if *label == "**" => { |
| 1486 | host_pattern_labels_match(rest, host) |
| 1487 | || (!host.is_empty() && host_pattern_labels_match(pattern, &host[1..])) |
| 1488 | } |
| 1489 | Some((label, rest)) if *label == "*" => { |
| 1490 | !host.is_empty() && host_pattern_labels_match(rest, &host[1..]) |
| 1491 | } |
| 1492 | Some((literal, rest)) => { |
| 1493 | host.first().is_some_and(|label| label == literal) |
| 1494 | && host_pattern_labels_match(rest, &host[1..]) |
| 1495 | } |
| 1496 | } |
| 1497 | } |
| 1498 | |
| 1499 | fn dynamic_token_grant_match_score(host: &str, path: &str) -> u32 { |
| 1500 | host_pattern_specificity(host) + endpoint_path_specificity(path) |
no test coverage detected