mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Updated request-ip package.
This commit is contained in:
parent
f9e4838d88
commit
39c0ea11c3
3 changed files with 7 additions and 13 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import path from 'path';
|
||||
import requestIp from 'request-ip';
|
||||
import { browserName, detectOS } from 'detect-browser';
|
||||
import isLocalhost from 'is-localhost-ip';
|
||||
|
|
@ -67,7 +68,7 @@ export async function getCountry(req, ip) {
|
|||
|
||||
// Database lookup
|
||||
if (!lookup) {
|
||||
lookup = await maxmind.open('node_modules/.geo/GeoLite2-Country.mmdb');
|
||||
lookup = await maxmind.open(path.resolve('node_modules/.geo/GeoLite2-Country.mmdb'));
|
||||
}
|
||||
|
||||
const result = lookup.get(ip);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue