Runner: Analyse null erlaubt, Adresse optional (R10)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-10-01 10:03:24 +00:00
1 parent 7de9f1aaa3
commit 18d37d1e01
4 files changed
+20 -4

No files matched your search

+2 -1
View File
@@ -48,7 +48,7 @@ export function validateJob(body) {
}
}
let analytics;
if (body.analytics !== undefined) {
if (body.analytics !== undefined && body.analytics !== null) {
const a = body.analytics;
if (!a || typeof a !== 'object' || Array.isArray(a)) return { ok: false, error: 'Ungültige Analyse-Angaben' };
if (typeof a.siteKey !== 'string' || !RE_SITE_KEY.test(a.siteKey)) return { ok: false, error: 'Ungültiger Analyse-Schlüssel' };
@@ -59,6 +59,7 @@ export function validateJob(body) {
for (const [k, max] of [['company', 200], ['address', 300], ['email', 200]]) {
const v = pr[k];
// eslint-disable-next-line no-control-regex
if (k === 'address' && (v === undefined || v === '')) { privacy[k] = ''; continue; }
if (typeof v !== 'string' || !v.trim() || v.length > max || /[\x00-\x1f\x7f]/.test(v)) return { ok: false, error: `Ungültige Analyse-Datenschutzangabe: ${k}` };
privacy[k] = v;
}