Update midware.js
Browse files- midware.js +0 -5
midware.js
CHANGED
@@ -25,8 +25,6 @@ class CheckMilWare {
|
|
25 |
console.log(`Extracted Real IP: ${realIP}`);
|
26 |
|
27 |
const isBlocked = await this.dbClient.CheckIsBlocked(realIP);
|
28 |
-
console.log(`CheckIsBlocked result for ${realIP}:`, isBlocked);
|
29 |
-
|
30 |
if (isBlocked && isBlocked.blocked === true) {
|
31 |
return res.status(403).send("Access denied: IP is blocked");
|
32 |
}
|
@@ -36,9 +34,6 @@ class CheckMilWare {
|
|
36 |
await this.dbClient.AddIpisBlocked(realIP);
|
37 |
return res.status(403).send("Access denied: IP is blocked..");
|
38 |
}
|
39 |
-
|
40 |
-
// await this.dbClient.IPAddressAndUpdate(realIP);
|
41 |
-
|
42 |
console.log(`Real IP address is: ${realIP}, header used: ${xForwardedFor ? "x-forwarded-for" : xRealIP ? "x-real-ip" : cfConnectingIP ? "cf-connecting-ip" : "req.ip"}`);
|
43 |
|
44 |
next();
|
|
|
25 |
console.log(`Extracted Real IP: ${realIP}`);
|
26 |
|
27 |
const isBlocked = await this.dbClient.CheckIsBlocked(realIP);
|
|
|
|
|
28 |
if (isBlocked && isBlocked.blocked === true) {
|
29 |
return res.status(403).send("Access denied: IP is blocked");
|
30 |
}
|
|
|
34 |
await this.dbClient.AddIpisBlocked(realIP);
|
35 |
return res.status(403).send("Access denied: IP is blocked..");
|
36 |
}
|
|
|
|
|
|
|
37 |
console.log(`Real IP address is: ${realIP}, header used: ${xForwardedFor ? "x-forwarded-for" : xRealIP ? "x-real-ip" : cfConnectingIP ? "cf-connecting-ip" : "req.ip"}`);
|
38 |
|
39 |
next();
|