Skip to content

Commit 01ada22

Browse files
authored
fixing correlation id (#981)
1 parent e402843 commit 01ada22

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

pkg/server/dns_server.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -305,18 +305,18 @@ func (h *DNSServer) handleInteraction(domain string, w dns.ResponseWriter, r *dn
305305
}
306306
}
307307
}
308-
}
309-
} else {
310-
parts := strings.Split(domain, ".")
311-
for i, part := range parts {
312-
for partChunk := range stringsutil.SlideWithLength(part, h.options.GetIdLength()) {
313-
normalizedPartChunk := strings.ToLower(partChunk)
314-
if h.options.isCorrelationID(normalizedPartChunk) {
315-
fullID = part
316-
if i+1 <= len(parts) {
317-
fullID = strings.Join(parts[:i+1], ".")
308+
} else {
309+
parts := strings.Split(domain, ".")
310+
for i, part := range parts {
311+
for partChunk := range stringsutil.SlideWithLength(part, h.options.GetIdLength()) {
312+
normalizedPartChunk := strings.ToLower(partChunk)
313+
if h.options.isCorrelationID(normalizedPartChunk) {
314+
fullID = part
315+
if i+1 <= len(parts) {
316+
fullID = strings.Join(parts[:i+1], ".")
317+
}
318+
uniqueID = normalizedPartChunk
318319
}
319-
uniqueID = normalizedPartChunk
320320
}
321321
}
322322
}

0 commit comments

Comments
 (0)