fix: allow wildcard maintenance

This commit is contained in:
2026-09-18 17:11:58 +00:00 Unverified
parent dcdacd5c04
commit 46d97138dc
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -31,11 +31,12 @@ export interface MaintenanceLeaseProvider {
export function normalizeMaintenanceHost(value: unknown): string {
if (typeof value !== "string") throw new Error("host is required");
const host = value.trim().toLowerCase().replace(/\.$/, "");
console.log(host)
if (
host.length === 0 ||
host.length > 253 ||
!host.includes(".") ||
!/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/.test(host)
!/^(?:\*\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/.test(host)
)
throw new Error("host must be a DNS hostname");
return host;