From: Michał Kępień Date: Thu, 21 May 2026 09:52:56 +0000 (+0200) Subject: Simplify match criteria for CookieHandler X-Git-Tag: v9.21.23~44^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ba6eee2b80064c459d21bb7a8723bea0a3d208fd;p=thirdparty%2Fbind9.git Simplify match criteria for CookieHandler The CookieHandler class handles all traffic for the "example." domain. Make it a subclass of DomainHandler to simplify its definition. --- diff --git a/bin/tests/system/resend_loop/ans3/ans.py b/bin/tests/system/resend_loop/ans3/ans.py index b5a1e754637..18074bcfb87 100644 --- a/bin/tests/system/resend_loop/ans3/ans.py +++ b/bin/tests/system/resend_loop/ans3/ans.py @@ -21,6 +21,7 @@ import dns.rrset from isctest.asyncserver import ( AsyncDnsServer, DnsResponseSend, + DomainHandler, QnameQtypeHandler, QueryContext, ResponseHandler, @@ -67,10 +68,8 @@ class ExampleNSHandler(QnameQtypeHandler, StaticResponseHandler): additional = [rrset("ns.example.", dns.rdatatype.A, "10.53.0.3")] -class CookieHandler(ResponseHandler): - def match(self, qctx: QueryContext) -> bool: - example = dns.name.from_text("example") - return qctx.qname.is_subdomain(example) +class CookieHandler(DomainHandler): + domains = ["example."] async def get_responses( self, qctx: QueryContext