Merge pull request #241 from PsychoLlama/master

Add ability to stop broadcast
This commit is contained in:
Mark Nadal 2016-10-14 15:04:17 -06:00 committed by GitHub
commit f73154c2e5
2 changed files with 11 additions and 9 deletions

View File

@ -114,7 +114,9 @@
// except for the ones that are listed in the message as having already been sending to. // except for the ones that are listed in the message as having already been sending to.
// all states, implemented with GET, are replied to the source that asked for it. // all states, implemented with GET, are replied to the source that asked for it.
function flow(req, res){ function flow(req, res){
if (!req.auth || req.headers.broadcast) {
gun.wsp.on('network').emit(Gun.obj.copy(req)); gun.wsp.on('network').emit(Gun.obj.copy(req));
}
if(req.headers.rid){ return } // no need to process. if(req.headers.rid){ return } // no need to process.
if(Gun.is.lex(req.body)){ return tran.get(req, res) } if(Gun.is.lex(req.body)){ return tran.get(req, res) }
else { return tran.put(req, res) } else { return tran.put(req, res) }

View File

@ -1,6 +1,6 @@
{ {
"name": "gun", "name": "gun",
"version": "0.3.995", "version": "0.3.996",
"description": "Graph engine", "description": "Graph engine",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {