block render from being proxied

This commit is contained in:
William Harrison committed 2025-05-28 12:06:29 +08:00
1 parent c8ee690e82
commit 74a1356d34
2 files changed
+38 -2

No files matched your search

+1 -2
View File
@@ -5,6 +5,5 @@
},
"records": {
"CNAME": "ziplineshockbs.onrender.com"
},
"proxied": true
}
}
+37
View File
@@ -49,3 +49,40 @@ t("Domains with proxy enabled must have at least one proxy-able record", (t) =>
validateProxiedRecords(t, data, file);
});
});
const disallowedRecords = [
{
type: "CNAME",
value: "*.onrender.com"
}
];
t("Domains with specific records must not have proxy enabled", (t) => {
files.forEach((file) => {
const data = getDomainData(file);
if (data.proxied) {
disallowedRecords.forEach((record) => {
let recordExists = false;
if (!data.records[record.type]) {
t.pass();
return;
} else if (Array.isArray(data.records[record.type])) {
recordExists = data.records[record.type].some((r) =>
record.value.startsWith("*.") ? r.endsWith(record.value.slice(2)) : r === record.value
);
} else {
recordExists = record.value.startsWith("*.")
? data.records[record.type].endsWith(record.value.slice(2))
: data.records[record.type] === record.value;
}
t.false(
recordExists,
`${file}: Records matching \`${record.type}: "${record.value}"\` cannot be proxied`
);
});
}
});
});