MCPcopy Create free account
hub / github.com/rthalley/dnspython / handle

Method handle

tests/test_query.py:596–608  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

594
595class TSIGNanoNameserver(Server):
596 def handle(self, request):
597 response = dns.message.make_response(request.message)
598 response.set_rcode(dns.rcode.REFUSED)
599 response.flags |= dns.flags.RA
600 try:
601 if request.qtype == dns.rdatatype.A and request.qclass == dns.rdataclass.IN:
602 rrs = dns.rrset.from_text(request.qname, 300, "IN", "A", "1.2.3.4")
603 response.answer.append(rrs)
604 response.set_rcode(dns.rcode.NOERROR)
605 response.flags |= dns.flags.AA
606 except Exception:
607 pass
608 return response
609
610
611@unittest.skipIf(not _nanonameserver_available, "nanonameserver required")

Callers

nothing calls this directly

Calls 2

set_rcodeMethod · 0.80
from_textMethod · 0.45

Tested by

no test coverage detected