From: Michał Kępień Date: Tue, 25 Mar 2025 04:01:34 +0000 (+0100) Subject: Make response handlers global by default X-Git-Tag: v9.21.7~32^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75567f86ca66f7aa598ccb6c093af8224e5e8753;p=thirdparty%2Fbind9.git Make response handlers global by default Instead of requiring each class inheriting from ResponseHandler to define its match() method, make the latter non-abstract and default to returning True for all queries. This will reduce the amount of boilerplate code in custom servers. --- diff --git a/bin/tests/system/isctest/asyncserver.py b/bin/tests/system/isctest/asyncserver.py index b4270fa8999..996db22893c 100644 --- a/bin/tests/system/isctest/asyncserver.py +++ b/bin/tests/system/isctest/asyncserver.py @@ -360,10 +360,13 @@ class ResponseHandler(abc.ABC): method. """ - @abc.abstractmethod + # pylint: disable=unused-argument def match(self, qctx: QueryContext) -> bool: """ - Matching logic - query is handled when it returns True. + Matching logic - the first handler whose `match()` method returns True + is used for handling the query. + + The default for each handler is to handle all queries. """ return True