minor anti-xss changes...

This commit is contained in:
Caleb James DeLisle
2017-08-24 13:53:42 +02:00
parent 75fde58846
commit 7bbea28831
6 changed files with 765 additions and 17 deletions

View File

@@ -67,7 +67,9 @@ define([
logLevel: logLevel
});
chainpad.onMessage(function(message, cb) {
sframeChan.query('Q_RT_MESSAGE', message, cb);
sframeChan.query('Q_RT_MESSAGE', message, function (ret) {
if (ret === 'OK') { cb(); }
});
});
chainpad.onPatch(function () {
onRemote({ realtime: chainpad });

View File

@@ -153,12 +153,16 @@ define([], function () {
if (message) {
// Do not remove wcObject, it allows us to use a new 'wc' without changing the handler if we
// want to keep the same chainpad (realtime) object
wcObject.wc.bcast(message).then(function() {
cb('OK');
}, function(err) {
// The message has not been sent, display the error.
console.error(err);
});
try {
wcObject.wc.bcast(message).then(function() {
cb('OK');
}, function(err) {
// The message has not been sent, display the error.
console.error(err);
});
} catch (e) {
cb('ERROR');
}
}
};
queue.forEach(function (arr) { messageFromInner(arr[0], arr[1]); });