mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-26 03:12:16 -04:00
Tweak the _get_cookie() method
The "len(cookie.server) == 0" condition is superfluous for the "resend_loop" system test, so remove it. Add a return type annotation to the _get_cookie() function.
This commit is contained in:
parent
c9ceb191e8
commit
5fa2bd7e53
1 changed files with 2 additions and 4 deletions
|
|
@ -28,13 +28,11 @@ from isctest.asyncserver import (
|
|||
)
|
||||
|
||||
|
||||
def _get_cookie(qctx: QueryContext):
|
||||
def _get_cookie(qctx: QueryContext) -> dns.edns.CookieOption | None:
|
||||
for o in qctx.query.options:
|
||||
if o.otype == dns.edns.OptionType.COOKIE:
|
||||
cookie = o
|
||||
if len(cookie.server) == 0:
|
||||
cookie.server = b"\x11\x22\x33\x44\x55\x66\x77\x88"
|
||||
|
||||
cookie.server = b"\x11\x22\x33\x44\x55\x66\x77\x88"
|
||||
return cookie
|
||||
|
||||
return None
|
||||
|
|
|
|||
Loading…
Reference in a new issue