Skip to content

Commit

Permalink
fixing correlation id (#981)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 authored Sep 28, 2024
1 parent e402843 commit 01ada22
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pkg/server/dns_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,18 +305,18 @@ func (h *DNSServer) handleInteraction(domain string, w dns.ResponseWriter, r *dn
}
}
}
}
} else {
parts := strings.Split(domain, ".")
for i, part := range parts {
for partChunk := range stringsutil.SlideWithLength(part, h.options.GetIdLength()) {
normalizedPartChunk := strings.ToLower(partChunk)
if h.options.isCorrelationID(normalizedPartChunk) {
fullID = part
if i+1 <= len(parts) {
fullID = strings.Join(parts[:i+1], ".")
} else {
parts := strings.Split(domain, ".")
for i, part := range parts {
for partChunk := range stringsutil.SlideWithLength(part, h.options.GetIdLength()) {
normalizedPartChunk := strings.ToLower(partChunk)
if h.options.isCorrelationID(normalizedPartChunk) {
fullID = part
if i+1 <= len(parts) {
fullID = strings.Join(parts[:i+1], ".")
}
uniqueID = normalizedPartChunk
}
uniqueID = normalizedPartChunk
}
}
}
Expand Down

0 comments on commit 01ada22

Please sign in to comment.