v0.34.0_1
This commit is contained in:
1 parent
9b3d6731cc
commit
00f29f92c8
68 files changed
+2599
-513
No files matched your search
@@ -10,8 +10,20 @@ impl Snapshot {
|
||||
local: SocketAddr,
|
||||
tls: bool,
|
||||
) -> Option<&CompiledRoute> {
|
||||
self.select_internal_on_arc(host, vhost_id, target, local, tls)
|
||||
.map(Arc::as_ref)
|
||||
}
|
||||
|
||||
pub fn select_internal_on_arc(
|
||||
&self,
|
||||
host: &str,
|
||||
vhost_id: &str,
|
||||
target: &str,
|
||||
local: SocketAddr,
|
||||
tls: bool,
|
||||
) -> Option<&Arc<CompiledRoute>> {
|
||||
for pattern in Self::host_patterns(host) {
|
||||
let owns_host = self.fallbacks.get(&pattern).is_some_and(|routes| {
|
||||
let owns_host = self.fallbacks.get(pattern.as_ref()).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))
|
||||
@@ -20,7 +32,7 @@ impl Snapshot {
|
||||
if !owns_host {
|
||||
continue;
|
||||
}
|
||||
return self.routes.get(&pattern).and_then(|routes| {
|
||||
return self.routes.get(pattern.as_ref()).and_then(|routes| {
|
||||
routes.iter().find(|route| {
|
||||
route.internal
|
||||
&& route.name == target
|
||||
|
||||
Reference in new issue
Block a user