mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 15:45:25 +00:00
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.
This commit is contained in:
@@ -360,10 +360,13 @@ class ResponseHandler(abc.ABC):
|
|||||||
method.
|
method.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@abc.abstractmethod
|
# pylint: disable=unused-argument
|
||||||
def match(self, qctx: QueryContext) -> bool:
|
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
|
return True
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user