Fix safe fetch DNS guard lint
Some checks failed
DB migration compat / Check if migrations changed (push) Has been cancelled
DB migration compat / Back-compat — Current branch migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Has been cancelled
DB migration compat / Forward-compat — Current branch code with ${{ needs.check-migrations-changed.outputs.base_branch }} branch migrations (push) Has been cancelled
DB migration compat / No migration changes (skipped) (push) Has been cancelled

This commit is contained in:
mantrakp04 2026-04-23 16:15:24 -07:00
parent 8998828c69
commit beb7d04968

View File

@ -126,10 +126,10 @@ async function resolveSafeFetchUrl(raw: string): Promise<ResolvedSafeFetchUrl |
return { kind: "error", reason: "hostname resolves to a disallowed IP range" };
}
}
const selected = resolved[0];
if (!selected) {
if (resolved.length === 0) {
return { kind: "error", reason: `DNS lookup returned no addresses for ${hostname}` };
}
const selected = resolved[0];
const family = toIpFamily(selected);
if (family === null) {
return { kind: "error", reason: `DNS lookup returned unsupported address family for ${hostname}` };