Skip to content

Commit fb5914b

Browse files
committed
fix: allow wildcard fallback in non-compat mode
The else branch used ? operator which returned error immediately on exact lookup failure, preventing the wildcard fallback from executing. Use if-let instead to fall through gracefully.
1 parent 6b2a018 commit fb5914b

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

gateway/src/proxy/tls_passthough.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,12 @@ async fn resolve_app_address(prefix: &str, sni: &str, compat: bool) -> Result<Ap
5858
};
5959
return AppAddress::parse(data).context("failed to parse app address");
6060
}
61-
} else {
62-
let lookup = resolver
63-
.txt_lookup(txt_domain)
64-
.await
65-
.context("failed to lookup app address")?;
66-
let txt_record = lookup.iter().next().context("no txt record found")?;
67-
let data = txt_record
68-
.txt_data()
69-
.first()
70-
.context("no data in txt record")?;
71-
return AppAddress::parse(data).context("failed to parse app address");
61+
} else if let Ok(lookup) = resolver.txt_lookup(txt_domain).await {
62+
if let Some(txt_record) = lookup.iter().next() {
63+
if let Some(data) = txt_record.txt_data().first() {
64+
return AppAddress::parse(data).context("failed to parse app address");
65+
}
66+
}
7267
}
7368

7469
// wildcard fallback: try {prefix}-wildcard.{parent_domain}

0 commit comments

Comments
 (0)