Fixes caching bug when CNAME leads to negative response

This commit is contained in:
Keele 2023-09-28 15:22:29 -05:00 committed by Benjamin Fry
parent c9a2ce42cb
commit 45bd92f4ac

View File

@ -245,7 +245,10 @@ where
Ok(Records::CnameChain {
next: future,
min_ttl: ttl,
}) => client.cname(future.await?, query, ttl),
}) => match future.await {
Ok(lookup) => client.cname(lookup, query, ttl),
Err(e) => client.cache(query, Err(e)),
},
Ok(Records::Exists(rdata)) => client.cache(query, Ok(rdata)),
Err(e) => client.cache(query, Err(e)),
}