Fixed labs.enabledMiddleware isSet reference (#13227)

no-issue

The `this` used by enabledMiddleware is not bound to `module.exports`.
This updates the middleware to reference the `isSet` method correctly
This commit is contained in:
Fabien 'egg' O'Carroll 2021-08-16 17:05:47 +01:00 committed by GitHub
parent e4d9c8daf2
commit 26940bea3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,7 +103,7 @@ module.exports.enabledHelper = function enabledHelper(options, callback) {
};
module.exports.enabledMiddleware = flag => (req, res, next) => {
if (this.isSet(flag) === true) {
if (module.exports.isSet(flag) === true) {
return next();
} else {
return next(new errors.NotFoundError());