From fd20190bff26b9b0e9acf30f3df7dcb977545ee6 Mon Sep 17 00:00:00 2001 From: Steven Wolfe Date: Fri, 22 Feb 2019 15:58:13 -0700 Subject: [PATCH] Verify hook names match for processing --- internal/server/hooks.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/server/hooks.go b/internal/server/hooks.go index 0314ea8e..cd37843e 100644 --- a/internal/server/hooks.go +++ b/internal/server/hooks.go @@ -10,6 +10,7 @@ import ( "time" "github.com/tidwall/buntdb" + "github.com/tidwall/gjson" "github.com/tidwall/resp" "github.com/tidwall/tile38/internal/endpoint" "github.com/tidwall/tile38/internal/glob" @@ -597,8 +598,11 @@ func (h *Hook) proc() (ok bool) { err := tx.AscendGreaterOrEqual("hooks", h.query, func(key, val string) bool { if strings.HasPrefix(key, hookLogPrefix) { - keys = append(keys, key) - vals = append(vals, val) + // Verify this hooks name matches the one in the notif + if h.Name == gjson.Get(val, "hook").String() { + keys = append(keys, key) + vals = append(vals, val) + } } return true },