randydev commited on
Commit
a0f3bc5
·
verified ·
1 Parent(s): 34cd3a2

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +4 -2
index.js CHANGED
@@ -113,8 +113,10 @@ app.use(async (req, res, next) => {
113
  res.status(403).send("access is blocked");
114
  }
115
  */
116
- let results = await CheckIsBlocked(realIP)
117
- console.log("Check blocked", results)
 
 
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();