Update middleware/midware.js
Browse files- middleware/midware.js +1 -3
middleware/midware.js
CHANGED
@@ -23,8 +23,6 @@ class CheckMilWare {
|
|
23 |
|
24 |
req.realIP = realIP;
|
25 |
|
26 |
-
console.log(`Extracted Real IP: ${realIP}`);
|
27 |
-
|
28 |
const isBlocked = await this.dbClient.CheckIsBlocked(realIP);
|
29 |
if (isBlocked && isBlocked.blocked) {
|
30 |
return res.status(403).send("Access denied: IP is blocked");
|
@@ -35,7 +33,7 @@ class CheckMilWare {
|
|
35 |
await this.dbClient.AddIpisBlocked(realIP);
|
36 |
return res.status(403).send("Access denied: IP is blocked..");
|
37 |
}
|
38 |
-
console.log(`Real IP address is: ${realIP}, header used: ${xForwardedFor ? "x-forwarded-for" : xRealIP ? "x-real-ip" : cfConnectingIP ? "cf-connecting-ip" : "req.ip"}`);
|
39 |
|
40 |
next();
|
41 |
} catch (error) {
|
|
|
23 |
|
24 |
req.realIP = realIP;
|
25 |
|
|
|
|
|
26 |
const isBlocked = await this.dbClient.CheckIsBlocked(realIP);
|
27 |
if (isBlocked && isBlocked.blocked) {
|
28 |
return res.status(403).send("Access denied: IP is blocked");
|
|
|
33 |
await this.dbClient.AddIpisBlocked(realIP);
|
34 |
return res.status(403).send("Access denied: IP is blocked..");
|
35 |
}
|
36 |
+
console.log(`Real IP address is: ${realIP}, path method: ${req.path}, header used: ${xForwardedFor ? "x-forwarded-for" : xRealIP ? "x-real-ip" : cfConnectingIP ? "cf-connecting-ip" : "req.ip"}`);
|
37 |
|
38 |
next();
|
39 |
} catch (error) {
|