Started adding slash commands, doesn't work though

This commit is contained in:
ION606
2022-09-26 15:41:20 +00:00
parent b6495eb886
commit ec4c1200d5
2214 changed files with 159174 additions and 42761 deletions
+9
View File
@@ -98,6 +98,8 @@ Route.prototype._options = function _options() {
Route.prototype.dispatch = function dispatch(req, res, done) {
var idx = 0;
var stack = this.stack;
var sync = 0
if (stack.length === 0) {
return done();
}
@@ -127,6 +129,11 @@ Route.prototype.dispatch = function dispatch(req, res, done) {
return done(err);
}
// max sync stack
if (++sync > 100) {
return setImmediate(next, err)
}
if (layer.method && layer.method !== method) {
return next(err);
}
@@ -136,6 +143,8 @@ Route.prototype.dispatch = function dispatch(req, res, done) {
} else {
layer.handle_request(req, res, next);
}
sync = 0
}
};