Merge pull request #2520 from ether/load-testing-settings
allow for load testing connections to hit by a setting
This commit is contained in:
commit
470b0ba2a6
|
@ -109,6 +109,9 @@
|
|||
// restrict socket.io transport methods
|
||||
"socketTransportProtocols" : ["xhr-polling", "jsonp-polling", "htmlfile"],
|
||||
|
||||
// Allow Load Testing tools to hit the Etherpad Instance. Warning this will disable security on the instance.
|
||||
"loadTest": false,
|
||||
|
||||
/* The toolbar buttons configuration.
|
||||
"toolbar": {
|
||||
"left": [
|
||||
|
|
|
@ -23,8 +23,12 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
|
||||
io.use(function(socket, accept) {
|
||||
var data = socket.request;
|
||||
// Use a setting if we want to allow load Testing
|
||||
if(!data.headers.cookie && settings.loadTest){
|
||||
accept(null, true);
|
||||
}else{
|
||||
if (!data.headers.cookie) return accept('No session cookie transmitted.', false);
|
||||
|
||||
}
|
||||
// Use connect's cookie parser, because it knows how to parse signed cookies
|
||||
connect.cookieParser(webaccess.secret)(data, {}, function(err){
|
||||
if(err) {
|
||||
|
|
|
@ -144,6 +144,11 @@ exports.loglevel = "INFO";
|
|||
*/
|
||||
exports.disableIPlogging = false;
|
||||
|
||||
/**
|
||||
* Disable Load Testing
|
||||
*/
|
||||
exports.loadTest = false;
|
||||
|
||||
/*
|
||||
* log4js appender configuration
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue