mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed issues with imageblobblur and typo in io.js
This commit is contained in:
@@ -434,8 +434,10 @@ module.exports = function() {
|
||||
if(list.hasOwnProperty("channel") && list.channel.indexOf("?") > -1){
|
||||
var _list = list.channel.substring(0, list.channel.indexOf("?"));
|
||||
list.channel = _list;
|
||||
coll = list.channel;
|
||||
}
|
||||
List.skip(list, guid, coll.replace(/ /g,''), offline, socket);
|
||||
if(coll != undefined) coll.replace(/ /g,'');
|
||||
List.skip(list, guid, coll, offline, socket);
|
||||
});
|
||||
|
||||
socket.on('conf', function(conf)
|
||||
@@ -443,8 +445,10 @@ module.exports = function() {
|
||||
if(conf.hasOwnProperty("channel") && conf.channel.indexOf("?") > -1){
|
||||
var _list = conf.channel.substring(0, conf.channel.indexOf("?"));
|
||||
conf.channel = _list;
|
||||
coll = conf.channel;
|
||||
}
|
||||
ListSettings.conf_function(conf, coll.replace(/ /g,''), guid, offline, socket);
|
||||
if(coll != undefined) coll.replace(/ /g,'');
|
||||
ListSettings.conf_function(conf, coll, guid, offline, socket);
|
||||
});
|
||||
|
||||
socket.on('shuffle', function(msg)
|
||||
@@ -589,12 +593,12 @@ module.exports = function() {
|
||||
|
||||
/*
|
||||
function send_ping() {
|
||||
db.collection("connected_users").update({users: {$exists: true}}, {$set: {users: []}}, {multi: true}, function(err, docs){
|
||||
db.collection("connected_users").update({"_id": "total_users"}, {$add: {total_users: 0}}, {multi: true}, function(err, docs){
|
||||
db.collection("frontpage_lists").update({viewers: {$ne: 0}}, {$set: {"viewers": 0}}, {multi: true}, function(err, docs) {
|
||||
io.emit("self_ping");
|
||||
setTimeout(send_ping, 25000);
|
||||
});
|
||||
});
|
||||
});
|
||||
db.collection("connected_users").update({users: {$exists: true}}, {$set: {users: []}}, {multi: true}, function(err, docs){
|
||||
db.collection("connected_users").update({"_id": "total_users"}, {$add: {total_users: 0}}, {multi: true}, function(err, docs){
|
||||
db.collection("frontpage_lists").update({viewers: {$ne: 0}}, {$set: {"viewers": 0}}, {multi: true}, function(err, docs) {
|
||||
io.emit("self_ping");
|
||||
setTimeout(send_ping, 25000);
|
||||
});
|
||||
});
|
||||
});
|
||||
}*/
|
||||
|
||||
@@ -1125,9 +1125,13 @@ router.route('/api/color').post(function(req, res) {
|
||||
|
||||
router.route('/api/imageblob').post(function(req, res) {
|
||||
var Jimp = require("jimp");
|
||||
try {
|
||||
var origin = req.get("origin").replace("https://", "").replace("http://", "");
|
||||
var allowed = ["client.localhost", "localhost", "zoff.me", "client.zoff.me", "zoff.no", "client.zoff.no"];
|
||||
if(allowed.indexOf(origin) < 0) {
|
||||
throw "Wrong origin";
|
||||
}
|
||||
} catch(e) {
|
||||
res.sendStatus(403);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user