cloudcms-server 3.2.316 → 3.2.317

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -345,6 +345,16 @@ exports = module.exports = function()
345
345
  {
346
346
  if (doesNotExist)
347
347
  {
348
+ console.log("BLOCK, method: " + req.method + ", url: " + req.url);
349
+ if (req.headers)
350
+ {
351
+ console.log(" -> headers: " + JSON.stringify(req.headers, null, 2));
352
+ }
353
+ if (req.query)
354
+ {
355
+ console.log(" -> query: " + JSON.stringify(req.query, null, 2));
356
+ }
357
+
348
358
  // are we being spoofed? kill the connection
349
359
  res.blocked = true;
350
360
  res.writeHead(503, { 'Content-Type': 'application/json' });
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "name": "cloudcms-server",
8
8
  "description": "Cloud CMS Application Server Module",
9
- "version": "3.2.316",
9
+ "version": "3.2.317",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "git://github.com/gitana/cloudcms-server.git"
package/server/index.js CHANGED
@@ -992,6 +992,36 @@ var startServer = function(config, startServerFinishedFn)
992
992
 
993
993
  next();
994
994
  });
995
+
996
+ // black list
997
+ app.use(function(req, res, next) {
998
+
999
+ var kill = false;
1000
+ if (req.path.endsWith("/env"))
1001
+ {
1002
+ kill = true;
1003
+ }
1004
+
1005
+ if (kill)
1006
+ {
1007
+ console.log("KILL, method: " + req.method + ", url: " + req.url);
1008
+ if (req.headers)
1009
+ {
1010
+ console.log(" -> headers: " + JSON.stringify(req.headers, null, 2));
1011
+ }
1012
+ if (req.query)
1013
+ {
1014
+ console.log(" -> query: " + JSON.stringify(req.query, null, 2));
1015
+ }
1016
+
1017
+ // are we being spoofed? kill the connection
1018
+ res.blocked = true;
1019
+ res.writeHead(503, { 'Content-Type': 'application/json' });
1020
+ return res.end(JSON.stringify({"error": true, "message": "Bad Request."}));
1021
+ }
1022
+
1023
+ next();
1024
+ });
995
1025
 
996
1026
  // common interceptors and config
997
1027
  main.common1(app);