Fix 500 on /api/send when client IP is malformed.
This commit is contained in:
1 parent
9da332c489
commit
3ebd5a44e8
2 files changed
+6
-6
No files matched your search
+1
-3
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user