Minor cleanup

This commit is contained in:
Shawn 2018-10-29 15:54:02 -05:00
parent a1ab73bd77
commit c92cd75f88

View file

@ -54,15 +54,11 @@ const autoblockPublishMiddleware = (req, res, next) => {
}
const autoblockPublishBodyMiddleware = (req, res, next) => {
console.log('REQUEST BODY', req.body)
if(req.body && publishingChannelWhitelist) {
let ip = (req.headers['x-forwarded-for'] || req.connection.remoteAddress).split(/,\s?/)[0];
const { channelName } = req.body;
console.log(channelName, publishingChannelWhitelist.indexOf(channelName) !== -1)
if(channelName && publishingChannelWhitelist.indexOf(channelName) !== -1) {
console.log('whitelisted channelName')
delete ipCounts[ip];
}
}