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()}) }