v0.34.0_13
This commit is contained in:
1 parent
929854898f
commit
1ca019d849
2 files changed
+61
-7
No files matched your search
@@ -22,25 +22,27 @@ impl Snapshot {
|
||||
local: SocketAddr,
|
||||
tls: bool,
|
||||
) -> Option<&Arc<CompiledRoute>> {
|
||||
for pattern in Self::host_patterns(host) {
|
||||
let owns_host = self.fallbacks.get(pattern.as_ref()).is_some_and(|routes| {
|
||||
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))
|
||||
})
|
||||
});
|
||||
if !owns_host {
|
||||
continue;
|
||||
return None;
|
||||
}
|
||||
return self.routes.get(pattern.as_ref()).and_then(|routes| {
|
||||
// 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))
|
||||
})
|
||||
});
|
||||
}
|
||||
None
|
||||
}))
|
||||
})
|
||||
.flatten()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user