fix(custom-domains): web-Domains nicht am alreadyGlobal-Check abweisen

Der alreadyGlobal-Pre-Check (Domain schon in der 208k-Layer-1-Blocklist →
kein Custom-Slot) gilt jetzt nur noch fuer Mail-Typen. Fuer type='web'
uebersprungen: Web-Custom-Domains speisen die Layer-2-VIP-Liste, eine separate
Schicht — eine global (Layer 1) gelistete Domain muss in die VIP koennen,
gerade weil Layer 2 das Netz ist, wenn Layer 1 aus ist.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
chahinebrini 2026-05-21 22:14:18 +02:00
parent c3390a0fed
commit ced749018b

View File

@ -168,18 +168,25 @@ export default defineEventHandler(async (event) => {
}); });
} }
// Pre-check: domain already on the global blocklist? Don't burn a slot for // Pre-check NUR für Mail-Typen: ist die Domain schon in der globalen
// something the 208k-domain global filter already covers. Return 200 with a // Blocklist? Dann keinen Slot verbrennen — der Mail-Daemon scannt dieselbe
// flag so the frontend can surface "already protected, no slot needed" // Blocklist, ein Custom-Slot wäre redundant.
// without the user paying for it. mail_domain is included in the same check //
// because mail-domains land in the same blocklist set the daemon scans. // Für `web` BEWUSST NICHT: Web-Custom-Domains speisen die Layer-2-VIP-Liste
const db = usePrisma(); // (webContent / Family Controls) — eine SEPARATE Schicht von der globalen
const globalMatch = await db.blocklistDomain.findFirst({ // Layer-1-Blocklist (URL-Filter / VPN). Eine Domain in Layer 1 ist NICHT
where: { domain: value, isActive: true }, // automatisch in der Layer-2-VIP-50; und Layer 2 ist gerade das Netz für den
select: { domain: true }, // Fall, dass Layer 1 deaktiviert wird. Global gelistete Domains müssen also
}); // in die VIP aufgenommen werden können.
if (globalMatch) { if (type !== "web") {
return { alreadyGlobal: true, domain: value }; const db = usePrisma();
const globalMatch = await db.blocklistDomain.findFirst({
where: { domain: value, isActive: true },
select: { domain: true },
});
if (globalMatch) {
return { alreadyGlobal: true, domain: value };
}
} }
// Per-type Slot-Limit prüfen // Per-type Slot-Limit prüfen