mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
closes #6525
This commit is contained in:
@@ -65,6 +65,9 @@ Blacklist.test = function (clientIp, callback) {
|
|||||||
// clientIp = '2001:db8:85a3:0:0:8a2e:370:7334'; // IPv6
|
// clientIp = '2001:db8:85a3:0:0:8a2e:370:7334'; // IPv6
|
||||||
// clientIp = '127.0.15.1'; // IPv4
|
// clientIp = '127.0.15.1'; // IPv4
|
||||||
// clientIp = '127.0.15.1:3443'; // IPv4 with port strip port to not fail
|
// clientIp = '127.0.15.1:3443'; // IPv4 with port strip port to not fail
|
||||||
|
if (!clientIp) {
|
||||||
|
return setImmediate(callback);
|
||||||
|
}
|
||||||
clientIp = clientIp.split(':').length === 2 ? clientIp.split(':')[0] : clientIp;
|
clientIp = clientIp.split(':').length === 2 ? clientIp.split(':')[0] : clientIp;
|
||||||
|
|
||||||
var addr;
|
var addr;
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ SocketPosts.reply = function (socket, data, callback) {
|
|||||||
data.timestamp = Date.now();
|
data.timestamp = Date.now();
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
|
function (next) {
|
||||||
|
meta.blacklist.test(data.req.ip, next);
|
||||||
|
},
|
||||||
function (next) {
|
function (next) {
|
||||||
posts.shouldQueue(socket.uid, data, next);
|
posts.shouldQueue(socket.uid, data, next);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ var topics = require('../topics');
|
|||||||
var posts = require('../posts');
|
var posts = require('../posts');
|
||||||
var websockets = require('./index');
|
var websockets = require('./index');
|
||||||
var user = require('../user');
|
var user = require('../user');
|
||||||
|
var meta = require('../meta');
|
||||||
var apiController = require('../controllers/api');
|
var apiController = require('../controllers/api');
|
||||||
var socketHelpers = require('./helpers');
|
var socketHelpers = require('./helpers');
|
||||||
|
|
||||||
@@ -28,6 +29,9 @@ SocketTopics.post = function (socket, data, callback) {
|
|||||||
data.timestamp = Date.now();
|
data.timestamp = Date.now();
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
|
function (next) {
|
||||||
|
meta.blacklist.test(data.req.ip, next);
|
||||||
|
},
|
||||||
function (next) {
|
function (next) {
|
||||||
posts.shouldQueue(socket.uid, data, next);
|
posts.shouldQueue(socket.uid, data, next);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user