0.34.6_repo_cleanup

This commit is contained in:
Mateusz Gruszczyński committed 2026-10-22 09:31:15 +02:00
1 parent ce1a90397c
commit 133d2f0f91
273 files changed
+5969 -6926

No files matched your search

+16 -9
View File
@@ -1,7 +1,4 @@
impl Snapshot {
/// Resolve a vhost-local internal named location. Internal locations are
/// deliberately excluded from ordinary URI matching and can only be reached
/// by an explicit internal dispatch such as an error fallback.
pub fn select_internal_on(
&self,
host: &str,
@@ -25,21 +22,31 @@ impl Snapshot {
Self::find_host_pattern(host, |pattern| {
let owns_host = self.fallbacks.get(pattern).is_some_and(|routes| {
routes.iter().any(|route| {
route.frontend.as_ref().is_some_and(|frontend| frontend.id == vhost_id)
&& route.bindings.iter().any(|binding| binding.matches(local, tls))
route
.frontend
.as_ref()
.is_some_and(|frontend| frontend.id == vhost_id)
&& route
.bindings
.iter()
.any(|binding| binding.matches(local, tls))
})
});
if !owns_host {
return None;
}
// Some(None) stops at the owning hostname even when the named
// location is absent. Do not try a less-specific wildcard.
Some(self.routes.get(pattern).and_then(|routes| {
routes.iter().find(|route| {
route.internal
&& route.name == target
&& route.frontend.as_ref().is_some_and(|frontend| frontend.id == vhost_id)
&& route.bindings.iter().any(|binding| binding.matches(local, tls))
&& route
.frontend
.as_ref()
.is_some_and(|frontend| frontend.id == vhost_id)
&& route
.bindings
.iter()
.any(|binding| binding.matches(local, tls))
})
}))
})