fix error when accessing from localhost
This commit is contained in:
1
index.js
1
index.js
@@ -78,6 +78,7 @@ app.use((req, res, next) => {
|
|||||||
const geo = geoip.lookup(req.headers['x-forwarded-for']);
|
const geo = geoip.lookup(req.headers['x-forwarded-for']);
|
||||||
console.log(geo);
|
console.log(geo);
|
||||||
|
|
||||||
|
if (geo)
|
||||||
if (geo.country !== "US")
|
if (geo.country !== "US")
|
||||||
if (geo.country !== "UA")
|
if (geo.country !== "UA")
|
||||||
if (geo.country !== "PL") {
|
if (geo.country !== "PL") {
|
||||||
|
|||||||
Reference in New Issue
Block a user