fix(rewrite): truncated upstream response (#7277)

Forward information that a upstream response is truncated when rewriting
a CNAME. Otherwise, the cache plugin stores the truncated resonse,
making it impossible to receive the full response as a client via TCP.

Signed-off-by: Yannick Epstein <yannicke@spotify.com>
This commit is contained in:
Yannick Epstein
2025-05-01 16:59:15 +02:00
committed by GitHub
parent abb0a52c5f
commit 13da7f749c
2 changed files with 35 additions and 4 deletions

View File

@@ -100,6 +100,9 @@ func (r *cnameTargetRuleWithReqState) RewriteResponse(res *dns.Msg, rr dns.RR) {
}
}
res.Answer = newAnswer
// if not propagated, the truncated response might get cached,
// and it will be impossible to resolve the full response
res.Truncated = upRes.Truncated
}
}
}