fix: close record repair and verification gaps
This commit is contained in:
1 parent
9251c85fd8
commit
adff599e08
27 files changed
+787
-153
No files matched your search
+5
-4
@@ -10,6 +10,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"maps"
|
||||
"math"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"slices"
|
||||
@@ -1473,8 +1474,8 @@ func (h zoneHandlers) createRecord(ctx context.Context, c *apiContext) (apiRespo
|
||||
}
|
||||
|
||||
func zoneAPIRequestedID(c *apiContext) (int64, error) {
|
||||
id, err := strconv.ParseInt(c.Vars["id"], 10, 32)
|
||||
if err != nil || id <= 0 {
|
||||
id, err := strconv.ParseInt(c.Vars["id"], 10, 64)
|
||||
if err != nil || id <= 0 || id > math.MaxUint32 {
|
||||
return 0, &apiError{Status: http.StatusBadRequest, Message: "invalid record id"}
|
||||
}
|
||||
c.Entry.RecordID = sql.NullInt64{Int64: id, Valid: true}
|
||||
@@ -1631,8 +1632,8 @@ func (h zoneHandlers) bulkDelete(ctx context.Context, c *apiContext) (apiRespons
|
||||
changes := zoneChanges{Deletes: make([]int64, 0, len(in.Records))}
|
||||
for _, item := range in.Records {
|
||||
var id int64
|
||||
if json.Unmarshal(item.ID, &id) != nil || id <= 0 || seen[id] {
|
||||
return apiResponse{}, zoneAPIFields(map[string]string{"records": "record ids must be distinct positive integers"})
|
||||
if json.Unmarshal(item.ID, &id) != nil || id <= 0 || id > math.MaxUint32 || seen[id] {
|
||||
return apiResponse{}, zoneAPIFields(map[string]string{"records": "record ids must be distinct integers from 1 to 4294967295"})
|
||||
}
|
||||
row, err := w.findRecord(id, byID)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user