fix(api): SNMP/hosts — одна строка на IP (DISTINCT ON), лимиты для больших сканов
Made-with: Cursor
This commit is contained in:
@@ -181,11 +181,11 @@ func (h *Handler) getScanHosts(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
limit := 500
|
||||
limit := 200000
|
||||
if raw := r.URL.Query().Get("limit"); raw != "" {
|
||||
n, err := strconv.Atoi(raw)
|
||||
if err != nil || n <= 0 || n > 5000 {
|
||||
writeError(w, http.StatusBadRequest, "limit must be between 1 and 5000")
|
||||
if err != nil || n <= 0 || n > 500000 {
|
||||
writeError(w, http.StatusBadRequest, "limit must be between 1 and 500000")
|
||||
return
|
||||
}
|
||||
limit = n
|
||||
@@ -233,11 +233,11 @@ func (h *Handler) getScanSNMP(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
limit := 1000
|
||||
limit := 200000
|
||||
if raw := r.URL.Query().Get("limit"); raw != "" {
|
||||
n, err := strconv.Atoi(raw)
|
||||
if err != nil || n <= 0 || n > 10000 {
|
||||
writeError(w, http.StatusBadRequest, "limit must be between 1 and 10000")
|
||||
if err != nil || n <= 0 || n > 500000 {
|
||||
writeError(w, http.StatusBadRequest, "limit must be between 1 and 500000")
|
||||
return
|
||||
}
|
||||
limit = n
|
||||
|
||||
Reference in New Issue
Block a user