index rebuild on black and whitelist
All checks were successful
release-tag / release-image (push) Successful in 1m52s

This commit is contained in:
2025-11-10 01:05:17 +01:00
parent 1a85c9d03f
commit 22d7515ab4

View File

@@ -1078,6 +1078,7 @@ func (s *server) handleWhitelist(w http.ResponseWriter, r *http.Request) {
http.Error(w, "store error", http.StatusInternalServerError) http.Error(w, "store error", http.StatusInternalServerError)
return return
} }
s.rebuildIndex()
writeJSON(w, map[string]any{ writeJSON(w, map[string]any{
"status": "whitelisted_ip", "status": "whitelisted_ip",
"ip": addr.String(), "ip": addr.String(),
@@ -1352,6 +1353,7 @@ func (s *server) handleBlacklistAdd(w http.ResponseWriter, r *http.Request) {
http.Error(w, "store error", http.StatusInternalServerError) http.Error(w, "store error", http.StatusInternalServerError)
return return
} }
s.rebuildIndex()
writeJSON(w, map[string]any{"status": "blacklisted", "prefix": pfx.String(), "reason": strings.TrimSpace(body.Reason)}) 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) http.Error(w, "store error", http.StatusInternalServerError)
return return
} }
s.rebuildIndex()
writeJSON(w, map[string]any{"status": "removed", "prefix": pfx.String()}) writeJSON(w, map[string]any{"status": "removed", "prefix": pfx.String()})
} }