change the way user ip address is retrieved

This commit is contained in:
wukko
2023-04-09 10:58:23 +06:00
parent b645abc34a
commit 7dc8ab252d
3 changed files with 9 additions and 6 deletions

View File

@@ -134,3 +134,6 @@ export function checkJSONPost(obj) {
return false
}
}
export function getIP(req) {
return req.header('cf-connecting-ip') ? req.header('cf-connecting-ip') : req.ip;
}