index rebuild on black and whitelist
All checks were successful
release-tag / release-image (push) Successful in 1m52s
All checks were successful
release-tag / release-image (push) Successful in 1m52s
This commit is contained in:
3
main.go
3
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()})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user