Skip to content

Commit be3591c

Browse files
authored
fix: exclude keys for non-matching domains on lookup (#476)
Signed-off-by: Aurora Gaffney <[email protected]>
1 parent 20434fc commit be3591c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/state/state.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,12 @@ func (s *State) lookupRecords(
336336
defer it.Close()
337337
for it.Seek(keyPrefix); it.ValidForPrefix(keyPrefix); it.Next() {
338338
item := it.Item()
339+
// Skip keys that don't have a purely numeric suffix
340+
// This means that they don't belong to the domain we are looking for
341+
keySuffix := item.Key()[len(keyPrefix):]
342+
if _, err := strconv.Atoi(string(keySuffix)); err != nil {
343+
continue
344+
}
339345
val, err := item.ValueCopy(nil)
340346
if err != nil {
341347
return err

0 commit comments

Comments
 (0)