mirror of
https://github.com/amark/gun.git
synced 2025-06-30 09:52:32 +00:00
Merge pull request #241 from PsychoLlama/master
Add ability to stop broadcast
This commit is contained in:
commit
f73154c2e5
@ -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) }
|
||||||
|
@ -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": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user