From ba6eee2b80064c459d21bb7a8723bea0a3d208fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 21 May 2026 11:52:56 +0200 Subject: [PATCH] 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. --- bin/tests/system/resend_loop/ans3/ans.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/tests/system/resend_loop/ans3/ans.py b/bin/tests/system/resend_loop/ans3/ans.py index b5a1e75463..18074bcfb8 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