From c44ada3061073bc3e7038b62e436f468d2eea885 Mon Sep 17 00:00:00 2001 From: Chris Sexton <3216719+chrissexton@users.noreply.github.com> Date: Wed, 4 Oct 2023 10:22:17 -0400 Subject: [PATCH] counter: fix decrement-by --- plugins/counter/api.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/counter/api.go b/plugins/counter/api.go index 7be7ee3..35eb4df 100644 --- a/plugins/counter/api.go +++ b/plugins/counter/api.go @@ -45,6 +45,8 @@ func (p *CounterPlugin) mkIncrementByNAPI(direction int) func(w http.ResponseWri delta, err := strconv.Atoi(chi.URLParam(r, "delta")) if err != nil || delta == 0 { delta = direction + } else { + delta = delta * direction } secret, pass, ok := r.BasicAuth()