]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
do not use : in cookie EDNS text output
authorBob Halley <halley@dnspython.org>
Sat, 13 Apr 2024 17:33:03 +0000 (10:33 -0700)
committerBob Halley <halley@dnspython.org>
Sat, 13 Apr 2024 17:33:03 +0000 (10:33 -0700)
dns/edns.py
tests/test_edns.py

index ef79b5f00f58f9cdcea3092aee40179f56e13ca1..af90827a514a0c90531f859ea70d3a026911de2e 100644 (file)
@@ -455,7 +455,7 @@ class CookieOption(Option):
             server = binascii.hexlify(self.server).decode()
         else:
             server = ""
-        return f"COOKIE {client}:{server}"
+        return f"COOKIE {client}{server}"
 
     @classmethod
     def from_wire_parser(
index 8e63b21dd74fb5d88e85d0a3e699162bae6d51e9..74b16c5c8deeb41c8df32228f20dea4dfaf58a0c 100644 (file)
@@ -222,11 +222,11 @@ class OptionTestCase(unittest.TestCase):
         opt.to_wire(io)
         data = io.getvalue()
         self.assertEqual(data, b"12345678")
-        self.assertEqual(str(opt), "COOKIE 3132333435363738:")
+        self.assertEqual(str(opt), "COOKIE 3132333435363738")
         opt = dns.edns.CookieOption(b"12345678", b"abcdefgh")
         data = opt.to_wire()
         self.assertEqual(data, b"12345678abcdefgh")
-        self.assertEqual(str(opt), "COOKIE 3132333435363738:6162636465666768")
+        self.assertEqual(str(opt), "COOKIE 31323334353637386162636465666768")
         # maximal server
         opt = dns.edns.CookieOption(b"12345678", b"abcdefghabcdefghabcdefghabcdefgh")
         io = BytesIO()