mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-10 09:31:54 -04:00
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.
(cherry picked from commit ba6eee2b80)
This commit is contained in:
parent
8bb18d304f
commit
b534090313
1 changed files with 3 additions and 4 deletions
|
|
@ -21,6 +21,7 @@ import dns.rrset
|
|||
from isctest.asyncserver import (
|
||||
AsyncDnsServer,
|
||||
DnsResponseSend,
|
||||
DomainHandler,
|
||||
QnameQtypeHandler,
|
||||
QueryContext,
|
||||
ResponseHandler,
|
||||
|
|
@ -60,10 +61,8 @@ class RootNSHandler(QnameQtypeHandler, StaticResponseHandler):
|
|||
additional = [rrset("a.root-servers.nil.", 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
|
||||
|
|
|
|||
Loading…
Reference in a new issue