Merge pull request #3505 from eoussama/master

Added optional website ID for creation
This commit is contained in:
Mike Cao authored and GitHub committed 2025-07-07 22:58:16 -07:00
commit b2a6e3f842
6 files changed
+43 -6

No files matched your search

+3 -1
View File
@@ -130,7 +130,9 @@ export async function getLocation(ip: string = '', headers: Headers, hasPayloadI
);
}
const result = global[MAXMIND].get(ip);
// When the client IP is extracted from headers, sometimes the value includes a port
const cleanIp = ip?.split(':')[0];
const result = global[MAXMIND].get(cleanIp);
if (result) {
const country = result.country?.iso_code ?? result?.registered_country?.iso_code;