From 22d7515ab49da2881871f93666969be49e2ee7f5 Mon Sep 17 00:00:00 2001 From: jbergner Date: Mon, 10 Nov 2025 01:05:17 +0100 Subject: [PATCH] index rebuild on black and whitelist --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index e4ea280..e6fefa7 100644 --- a/main.go +++ b/main.go @@ -1078,6 +1078,7 @@ func (s *server) handleWhitelist(w http.ResponseWriter, r *http.Request) { http.Error(w, "store error", http.StatusInternalServerError) return } + s.rebuildIndex() writeJSON(w, map[string]any{ "status": "whitelisted_ip", "ip": addr.String(), @@ -1352,6 +1353,7 @@ func (s *server) handleBlacklistAdd(w http.ResponseWriter, r *http.Request) { http.Error(w, "store error", http.StatusInternalServerError) return } + s.rebuildIndex() writeJSON(w, map[string]any{"status": "blacklisted", "prefix": pfx.String(), "reason": strings.TrimSpace(body.Reason)}) } @@ -1371,6 +1373,7 @@ func (s *server) handleBlacklistDel(w http.ResponseWriter, r *http.Request) { http.Error(w, "store error", http.StatusInternalServerError) return } + s.rebuildIndex() writeJSON(w, map[string]any{"status": "removed", "prefix": pfx.String()}) }