diff --git a/readme.md b/readme.md index f262156..dde6a7b 100644 --- a/readme.md +++ b/readme.md @@ -7,8 +7,6 @@ A client centric websocket service that lets the clients put anything on a share It is inspired by redux, and my desire to rapidly prototype browserbased multiplayer games. - # Todo * Scopes, server-private scopes -* Private actions, add "public:set", "public:set:all" etc. -* Multiple reducers? \ No newline at end of file +* Add XSS protection and fix the lodash securety issue.. diff --git a/src/table.js b/src/table.js index fb74fb4..a2db20c 100644 --- a/src/table.js +++ b/src/table.js @@ -39,15 +39,12 @@ module.exports = function ({ initialState = {}, reducers = {}, effects = [], pin ctx.websocket.on('message', (rawReq) => { const req = JSON.parse(rawReq); - - const allowed = allowedActions.reduce((acc, curr) => { - return acc || (req.type.indexOf(curr) > -1) - }, false) + const allowed = allowedActions.indexOf(req.type) > -1; if(allowed) { store.dispatch({ - type: req.type ? req.type : 'message', - data: req.data ? req.data : rawReq, + type: req.type, + data: req.data, socket: ctx.websocket }); }