mirror of
https://github.com/coredns/coredns.git
synced 2026-10-15 23:10:43 -04:00
plugin/etcd: Stop target stripping at the end of a name (#8584)
Stops stripping when the next-label operation reaches the end sentinel in DNS Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
@@ -165,6 +165,9 @@ func targetStrip(name string, targetStrip int) string {
|
||||
offset, end := 0, false
|
||||
for range targetStrip {
|
||||
offset, end = dns.NextLabel(name, offset)
|
||||
if end {
|
||||
break
|
||||
}
|
||||
}
|
||||
if end {
|
||||
// We overshot the name, use the original one.
|
||||
|
||||
Reference in New Issue
Block a user