diff --git a/packages/core/server/src/middlewares/acl-selector.ts b/packages/core/server/src/middlewares/acl-selector.ts index ba72e44bb8..524041697c 100644 --- a/packages/core/server/src/middlewares/acl-selector.ts +++ b/packages/core/server/src/middlewares/acl-selector.ts @@ -1,9 +1,13 @@ export function AclSelectorMiddleware() { return async (ctx, next) => { const connectionName = ctx.get('x-connection'); - const aclInstance = connectionName ? ctx.app.acls.get(connectionName) : ctx.app.acl; + if (connectionName) { + await next(); + } else { + const aclInstance = connectionName ? ctx.app.acls.get(connectionName) : ctx.app.acl; - const middleware = aclInstance.middleware(); - await middleware(ctx, next); + const middleware = aclInstance.middleware(); + await middleware(ctx, next); + } }; }