(pattern: &[&str], host: &[&str])
| 693 | } |
| 694 | |
| 695 | fn host_pattern_labels_match(pattern: &[&str], host: &[&str]) -> bool { |
| 696 | match pattern.split_first() { |
| 697 | None => host.is_empty(), |
| 698 | Some((label, rest)) if *label == "**" => { |
| 699 | host_pattern_labels_match(rest, host) |
| 700 | || (!host.is_empty() && host_pattern_labels_match(pattern, &host[1..])) |
| 701 | } |
| 702 | Some((label, rest)) if *label == "*" => { |
| 703 | !host.is_empty() && host_pattern_labels_match(rest, &host[1..]) |
| 704 | } |
| 705 | Some((literal, rest)) => { |
| 706 | host.first().is_some_and(|label| label == literal) |
| 707 | && host_pattern_labels_match(rest, &host[1..]) |
| 708 | } |
| 709 | } |
| 710 | } |
| 711 | |
| 712 | fn dynamic_token_grant_match_score(host: &str, path: &str) -> u32 { |
| 713 | host_pattern_specificity(host) + endpoint_path_specificity(path) |
no test coverage detected