plugin/file: guard against cname loops (#4387)

Automatically submitted.
This commit is contained in:
Miek Gieben
2021-01-15 19:26:04 +01:00
committed by GitHub
parent f5f977f4c8
commit 342eae9b4b
8 changed files with 84 additions and 4 deletions

View File

@@ -145,6 +145,7 @@ func (s *ServerHTTPS) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// We just call the normal chain handler - all error handling is done there.
// We should expect a packet to be returned that we can send to the client.
ctx := context.WithValue(context.Background(), Key{}, s.Server)
ctx = context.WithValue(ctx, LoopKey{}, 0)
s.ServeDNS(ctx, dw, msg)
// See section 4.2.1 of RFC 8484.