chore: treat missing source ip as non-private for open-task external classification
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 8s

This commit is contained in:
OG T
2026-06-07 16:10:02 +08:00
parent 40ea6f7090
commit 7f48e18034

View File

@@ -52,8 +52,11 @@ function resolveSourceIp(request: Request) {
function isPrivateIp(ip: string | undefined) {
if (!ip) return false;
const normalized = ip.trim().toLowerCase();
if (!normalized || normalized === "unknown" || normalized === "::1" || normalized === "localhost") {
return true;
if (!normalized) {
return false;
}
if (normalized === "::1" || normalized === "localhost") {
return false;
}
if (normalized.startsWith("127.") || normalized.startsWith("10.") || normalized.startsWith("192.168.")) {