Merge pull request #2520 from ether/load-testing-settings

allow for load testing connections to hit by a setting
This commit is contained in:
John McLear 2015-02-22 14:41:09 +00:00
commit 470b0ba2a6
3 changed files with 14 additions and 2 deletions

View File

@ -108,6 +108,9 @@
// restrict socket.io transport methods // restrict socket.io transport methods
"socketTransportProtocols" : ["xhr-polling", "jsonp-polling", "htmlfile"], "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. /* The toolbar buttons configuration.
"toolbar": { "toolbar": {

View File

@ -23,8 +23,12 @@ exports.expressCreateServer = function (hook_name, args, cb) {
io.use(function(socket, accept) { io.use(function(socket, accept) {
var data = socket.request; 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 // Use connect's cookie parser, because it knows how to parse signed cookies
connect.cookieParser(webaccess.secret)(data, {}, function(err){ connect.cookieParser(webaccess.secret)(data, {}, function(err){
if(err) { if(err) {

View File

@ -144,6 +144,11 @@ exports.loglevel = "INFO";
*/ */
exports.disableIPlogging = false; exports.disableIPlogging = false;
/**
* Disable Load Testing
*/
exports.loadTest = false;
/* /*
* log4js appender configuration * log4js appender configuration
*/ */