chore: integrate current main into hardening

This commit is contained in:
Affaan Mustafa
2026-07-26 06:26:28 -04:00
144 changed files with 9261 additions and 296 deletions
+6 -1
View File
@@ -18,6 +18,7 @@ const {
isAllowedHostHeader,
isAllowedOrigin,
} = require('./lib/loopback-guard');
const { normalizeAgentTools } = require('./lib/agent-tools');
const DEFAULT_HOST = '127.0.0.1';
@@ -52,7 +53,11 @@ function readFrontmatter(p) {
const s = l.indexOf(':'); if (s <= 0) continue;
let k = l.slice(0, s).trim(), v = l.slice(s + 1).trim();
if ((v.startsWith('"') && v.endsWith('"')) || (v.startsWith("'") && v.endsWith("'"))) v = v.slice(1, -1);
if (v.startsWith('[') && v.endsWith(']')) { try { v = JSON.parse(v); } catch { v = v.slice(1, -1).split(',').map(x => x.trim().replace(/["']/g, '')); } }
if (k === 'tools') {
v = normalizeAgentTools(v);
} else if (v.startsWith('[') && v.endsWith(']')) {
try { v = JSON.parse(v); } catch { v = v.slice(1, -1).split(',').map(x => x.trim().replace(/["']/g, '')); }
}
fm[k] = v;
}
fm._body = c.replace(/^---[\s\S]*?---\n*/, '').trim();