@ -41,7 +41,7 @@ const BLACKLISTED_SUBDOMAINS = new Set([
export function checkSubdomainValidity ( subdomain : string ) : void {
export function checkSubdomainValidity ( subdomain : string ) : void {
// stick with limited alphanumeric subdomains.
// stick with limited alphanumeric subdomains.
if ( ! ( /^[a-z0-9][-a-z0-9]*$/ . test ( subdomain ) ) ) {
if ( ! ( /^[a-z0-9][-a-z0-9]*$/ . test ( subdomain ) ) ) {
throw new Error ( 'Domain must include l etters, numbers, and dashes only.') ;
throw new Error ( 'Domain must include l ower-case l etters, numbers, and dashes only.') ;
}
}
// 'docs-*' is reserved for personal orgs.
// 'docs-*' is reserved for personal orgs.
if ( subdomain . startsWith ( 'docs-' ) ) { throw new Error ( 'Domain cannot use reserved prefix "docs-".' ) ; }
if ( subdomain . startsWith ( 'docs-' ) ) { throw new Error ( 'Domain cannot use reserved prefix "docs-".' ) ; }