Release 2.6.2-rc1
This commit is contained in:
@@ -27,7 +27,7 @@ export interface MaintenanceLeaseProvider {
|
||||
): Promise<{ release(): Promise<void> } | undefined>;
|
||||
}
|
||||
|
||||
/** Accept DNS hostnames only: no URL syntax, port, address literals, or wildcards. */
|
||||
/** Accept DNS hostnames and an optional leading *. only; no URL syntax, port, or address literals. */
|
||||
export function normalizeMaintenanceHost(value: unknown): string {
|
||||
if (typeof value !== "string") throw new Error("host is required");
|
||||
const host = value.trim().toLowerCase().replace(/\.$/, "");
|
||||
@@ -35,7 +35,7 @@ export function normalizeMaintenanceHost(value: unknown): string {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user