v1.18.x
Barış Soner Uşaklı 7 years ago
parent e96b2a4d2a
commit c1fb3c2da4

@ -65,6 +65,9 @@ Blacklist.test = function (clientIp, callback) {
// clientIp = '2001:db8:85a3:0:0:8a2e:370:7334'; // IPv6
// clientIp = '127.0.15.1'; // IPv4
// 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;
var addr;

@ -32,6 +32,9 @@ SocketPosts.reply = function (socket, data, callback) {
data.timestamp = Date.now();
async.waterfall([
function (next) {
meta.blacklist.test(data.req.ip, next);
},
function (next) {
posts.shouldQueue(socket.uid, data, next);
},

@ -6,6 +6,7 @@ var topics = require('../topics');
var posts = require('../posts');
var websockets = require('./index');
var user = require('../user');
var meta = require('../meta');
var apiController = require('../controllers/api');
var socketHelpers = require('./helpers');
@ -28,6 +29,9 @@ SocketTopics.post = function (socket, data, callback) {
data.timestamp = Date.now();
async.waterfall([
function (next) {
meta.blacklist.test(data.req.ip, next);
},
function (next) {
posts.shouldQueue(socket.uid, data, next);
},

Loading…
Cancel
Save