mirror of
https://github.com/amark/gun.git
synced 2025-06-06 14:16:44 +00:00
commit
edf0f01c3e
2
gun.min.js
vendored
2
gun.min.js
vendored
File diff suppressed because one or more lines are too long
@ -46,6 +46,11 @@ Gun.on('opt', function(context) {
|
|||||||
var opt = context.opt || {};
|
var opt = context.opt || {};
|
||||||
var ws = opt.ws || {};
|
var ws = opt.ws || {};
|
||||||
|
|
||||||
|
if (!opt.verify) {
|
||||||
|
this.to.next(context);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* verify when instantiating Gun can contain the following keys:
|
* verify when instantiating Gun can contain the following keys:
|
||||||
* allowOrigins: Array|RegExp|String
|
* allowOrigins: Array|RegExp|String
|
||||||
@ -53,12 +58,7 @@ Gun.on('opt', function(context) {
|
|||||||
* authKey: String
|
* authKey: String
|
||||||
* check: Function
|
* check: Function
|
||||||
*/
|
*/
|
||||||
var verify = opt.verify || {};
|
var verify = opt.verify;
|
||||||
if (!verify) {
|
|
||||||
this.to.next(context);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ws.verifyClient && !verify.override) {
|
if (ws.verifyClient && !verify.override) {
|
||||||
throw Error('Cannot override existing verifyClient option in `ws` configuration.');
|
throw Error('Cannot override existing verifyClient option in `ws` configuration.');
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ Gun._ = { // some reserved key words, these are not the only ones.
|
|||||||
if(!obj_is(at.opt.peers)){ at.opt.peers = {}}
|
if(!obj_is(at.opt.peers)){ at.opt.peers = {}}
|
||||||
at.opt.peers = obj_to(tmp, at.opt.peers);
|
at.opt.peers = obj_to(tmp, at.opt.peers);
|
||||||
}
|
}
|
||||||
at.opt.wsc = at.opt.wsc || {protocols:null}
|
at.opt.wsc = at.opt.wsc || {protocols:''}
|
||||||
at.opt.peers = at.opt.peers || {};
|
at.opt.peers = at.opt.peers || {};
|
||||||
obj_to(opt, at.opt); // copies options on to `at.opt` only if not already taken.
|
obj_to(opt, at.opt); // copies options on to `at.opt` only if not already taken.
|
||||||
Gun.on('opt', at);
|
Gun.on('opt', at);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user