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)
|
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()})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user