Merge pull request #2520 from ether/load-testing-settings
allow for load testing connections to hit by a settingpull/2525/head
commit
470b0ba2a6
|
@ -108,6 +108,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": {
|
||||
|
|
|
@ -23,8 +23,12 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
|
||||
io.use(function(socket, accept) {
|
||||
var data = socket.request;
|
||||
if (!data.headers.cookie) return accept('No session cookie transmitted.', false);
|
||||
|
||||
// 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