mirror of
https://github.com/coredns/coredns.git
synced 2026-07-15 12:10:11 -04:00
fix(rewrite): restore the original question on empty replies (#8212)
Signed-off-by: immanuwell <pchpr.00@list.ru>
This commit is contained in:
committed by
GitHub
parent
4faf983fb6
commit
33266a45c7
@@ -73,7 +73,11 @@ func (r *ResponseReverter) WriteMsg(res1 *dns.Msg) error {
|
||||
res := res1.Copy()
|
||||
|
||||
if r.revertPolicy.DoQuestionRestore() {
|
||||
res.Question[0] = r.originalQuestion
|
||||
if len(res.Question) == 0 {
|
||||
res.Question = []dns.Question{r.originalQuestion}
|
||||
} else {
|
||||
res.Question[0] = r.originalQuestion
|
||||
}
|
||||
}
|
||||
if len(r.ResponseRules) > 0 {
|
||||
for _, rr := range res.Ns {
|
||||
|
||||
Reference in New Issue
Block a user