Fix 500 on /api/send when client IP is malformed.

This commit is contained in:
Mike Cao committed 2026-04-28 19:47:38 -07:00
1 parent 9da332c489
commit 3ebd5a44e8
2 files changed
+6 -6

No files matched your search

+1 -3
View File
@@ -84,9 +84,7 @@ export function getIpAddress(headers: Headers) {
if (header === 'forwarded') {
const match = ip.match(/for=(\[?[0-9a-fA-F:.]+]?)/);
if (match) {
return resolveIp(match[1]);
}
return match ? resolveIp(match[1]) : undefined;
}
return resolveIp(ip);