Add additional internal TLDs to domain validation

This commit is contained in:
Maurus Decimus
2026-06-06 11:46:45 +02:00
parent bfd8e2cfc6
commit bdd7f74ebd
2 changed files with 13 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If
## Changed ## Changed
- OAuth: Rework access tokens to an `AES-256-GCM-SIV` AEAD format that carries the account name for proxy routing and revokes tokens on credential change. - OAuth: Rework access tokens to an `AES-256-GCM-SIV` AEAD format that carries the account name for proxy routing and revokes tokens on credential change.
- Added more internal TLDs to the domain validation.
## Fixed ## Fixed
- MTA: - MTA:

View File

@@ -354,7 +354,18 @@ pub fn sanitize_domain(domain: &str) -> Option<String> {
} }
pub fn is_valid_domain(domain: &str) -> bool { pub fn is_valid_domain(domain: &str) -> bool {
const RESERVED_TLDS: &[&str] = &["test", "localhost", "local", "internal"]; const RESERVED_TLDS: &[&str] = &[
"test",
"localhost",
"local",
"internal",
"lan",
"home",
"corp",
"intranet",
"private",
"localdomain",
];
psl::domain(domain.as_bytes()).is_some_and(|d| d.suffix().typ().is_some()) psl::domain(domain.as_bytes()).is_some_and(|d| d.suffix().typ().is_some())
|| RESERVED_TLDS.contains(&domain) || RESERVED_TLDS.contains(&domain)
|| domain || domain