randydev commited on
Commit
c82fac4
·
verified ·
1 Parent(s): 03ba349

Update middleware/midware.js

Browse files
Files changed (1) hide show
  1. middleware/midware.js +4 -1
middleware/midware.js CHANGED
@@ -5,7 +5,6 @@ import { ApiKey } from '../models.js';
5
  import { TelegramUseLogNotif } from '../lib/all.js';
6
  import * as config from '../config.js';
7
 
8
-
9
  const authenticateApiKeyPremium = async (req, res, next) => {
10
  const apiKey = req.headers['x-api-key'];
11
 
@@ -118,6 +117,10 @@ class CheckMilWare {
118
  await this.dbClient.AddIpisBlocked(realIP);
119
  return res.status(403).send("Access denied: IP is blocked..");
120
  }
 
 
 
 
121
  res.on("finish", function() {
122
  console.log(`Real IP address is: ${realIP}
123
  path method: ${req.path}
 
5
  import { TelegramUseLogNotif } from '../lib/all.js';
6
  import * as config from '../config.js';
7
 
 
8
  const authenticateApiKeyPremium = async (req, res, next) => {
9
  const apiKey = req.headers['x-api-key'];
10
 
 
117
  await this.dbClient.AddIpisBlocked(realIP);
118
  return res.status(403).send("Access denied: IP is blocked..");
119
  }
120
+ if (req.path.endsWith('.php')) {
121
+ return res.status(403).send('Access to .php files is forbidden');
122
+ }
123
+
124
  res.on("finish", function() {
125
  console.log(`Real IP address is: ${realIP}
126
  path method: ${req.path}