diff --git a/server/client.go b/server/client.go index 70f8641c..e16b8667 100644 --- a/server/client.go +++ b/server/client.go @@ -895,10 +895,10 @@ func (c *client) processMsg(msg []byte) { } if !ok { r := c.perms.pub.Match(string(c.pa.subject)) - if len(r.psubs) == 0 { + notAllowed := len(r.psubs) == 0 + if notAllowed { c.pubPermissionViolation(c.pa.subject) c.perms.pcache[string(c.pa.subject)] = false - return } else { c.perms.pcache[string(c.pa.subject)] = true } @@ -914,6 +914,10 @@ func (c *client) processMsg(msg []byte) { } } } + // Return here to allow the pruning code to run if needed. + if notAllowed { + return + } } }