Analyse: Eingaben und Liste robuster

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-10-01 10:22:19 +00:00
1 parent f4c8b291d7
commit fc937b0d1e
3 files changed
+34 -4

No files matched your search

+4 -2
View File
@@ -56,7 +56,9 @@ export async function analyseEligibility(customerId, projectId) {
return { ok: true, project }
}
/** `<subdomain>.project.webklar.com` plus Live-Domain (klein, ohne Schema/Pfad), ohne Doppelte. */
const HOSTNAME_RE = /^(?=.{4,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z][a-z0-9-]{0,61}[a-z0-9]$/
/** `<subdomain>.project.webklar.com` plus Live-Domain (klein, ohne Schema/Pfad), ohne Doppelte; ungueltige Hosts werden uebersprungen. */
export function analyseDomains(project) {
const domains = []
if (project.subdomain) domains.push(`${String(project.subdomain).trim().toLowerCase()}.project.webklar.com`)
@@ -66,7 +68,7 @@ export function analyseDomains(project) {
.replace(/^[a-z]+:\/\//, '')
.replace(/[/?#].*$/, '')
if (live) domains.push(live)
return [...new Set(domains)]
return [...new Set(domains)].filter((d) => HOSTNAME_RE.test(d))
}
async function customerOf(customerId) {