fix: increase random subdomain suffix

This commit is contained in:
Philipinho
2025-05-07 15:10:58 +01:00
parent 7adbf85030
commit bc3cb2d63f

View File

@ -387,14 +387,14 @@ export class WorkspaceService {
.replace(/[^a-z0-9]/g, '')
.substring(0, 20);
// Ensure we leave room for a random suffix.
const maxSuffixLength = 3;
const maxSuffixLength = 6;
if (subdomain.length < 4) {
subdomain = `${subdomain}-${generateRandomSuffix(maxSuffixLength)}`;
}
if (DISALLOWED_HOSTNAMES.includes(subdomain)) {
subdomain = `myworkspace-${generateRandomSuffix(maxSuffixLength)}`;
subdomain = `workspace-${generateRandomSuffix(maxSuffixLength)}`;
}
let uniqueHostname = subdomain;