Update index.js
Browse files
index.js
CHANGED
@@ -113,8 +113,10 @@ app.use(async (req, res, next) => {
|
|
113 |
res.status(403).send("access is blocked");
|
114 |
}
|
115 |
*/
|
116 |
-
|
117 |
-
|
|
|
|
|
118 |
await IPAddressAndUpdate(realIP);
|
119 |
console.log(`Real IP address is: ${realIP}, header: ${xForwardedFor ? "x-forwarded-for" : xRealIP ? "x-real-ip" : cfConnectingIP ? "cf-connecting-ip" : "req.ip"} `);
|
120 |
await next();
|
|
|
113 |
res.status(403).send("access is blocked");
|
114 |
}
|
115 |
*/
|
116 |
+
const isBlocked = await CheckIsBlocked(realIP)
|
117 |
+
if (isBlocked.blocked) {
|
118 |
+
res.status(403).send("access is Ip blocked");
|
119 |
+
}
|
120 |
await IPAddressAndUpdate(realIP);
|
121 |
console.log(`Real IP address is: ${realIP}, header: ${xForwardedFor ? "x-forwarded-for" : xRealIP ? "x-real-ip" : cfConnectingIP ? "cf-connecting-ip" : "req.ip"} `);
|
122 |
await next();
|