ignore most staff TXT records + reserve more

This commit is contained in:
William Harrison committed 2025-04-23 16:17:07 +08:00
1 parent d875db0e43
commit e54324544d
11 files changed
+15 -75

No files matched your search

+6 -2
View File
@@ -139,7 +139,10 @@ function validateRecordValues(t, data, file) {
if (key === "CNAME") {
t.true(isValidHostname(value), `${file}: Invalid hostname for ${key}`);
t.true(value !== file, `${file}: CNAME cannot point to itself`);
t.true(value !== `${subdomain}.is-a.dev`, `${file}: ${key} cannot point to itself`);
if (data.owner.username.toLowerCase() !== "is-a-dev") {
t.true(value !== "is-a.dev", `${file}: ${key} cannot point to is-a.dev`);
}
} else if (key === "URL") {
t.true(
value.startsWith("http://") || value.startsWith("https://"),
@@ -149,7 +152,8 @@ function validateRecordValues(t, data, file) {
// Check for self-referencing redirects
const urlHost = new URL(value).host;
t.false(urlHost === `${subdomain}.is-a.dev`, `${file}: URL cannot point to itself`);
t.true(isValidHostname(urlHost), `${file}: Invalid URL hostname for ${key}`);
t.false(urlHost === `${subdomain}.is-a.dev`, `${file}: ${key} cannot point to itself`);
}
}