]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Do not mutate default values 16490/head
authorJosh Soref <2119212+jsoref@users.noreply.github.com>
Thu, 13 Nov 2025 14:20:51 +0000 (09:20 -0500)
committerJosh Soref <2119212+jsoref@users.noreply.github.com>
Thu, 13 Nov 2025 14:20:51 +0000 (09:20 -0500)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
modules/remotebackend/pdns_unittest.py
regression-tests.dnsdist/dnsdisttests.py

index 469c545a487a5a7dc628d806d46586a7d4f5fab2..3021dbd84f22bf076e27be2292e160dfcae1a896 100644 (file)
@@ -113,7 +113,9 @@ class Handler(pdns.remotebackend.Handler):
                 domain['meta'][kind] = value
             self.result = True
 
-    def do_adddomainkey(self, name='', key={}, **kwargs):
+    def do_adddomainkey(self, name='', key=None, **kwargs):
+        if key is None:
+            key = {}
         domain = self.get_domain(name)
         if domain:
             k_id = len(domain['keys']) + 1
index 36ab4c51ba8ab3b5341b82707d0f7f083f895102..24e2c22ed05bc7363c6636d986f1bd379dd62a1c 100644 (file)
@@ -993,7 +993,9 @@ class DNSDistTest(AssertEqualDNSMessageMixin, unittest.TestCase):
         except subprocess.CalledProcessError as exc:
             raise AssertionError('openssl pkcs12 failed (%d): %s' % (exc.returncode, exc.output))
 
-    def checkMessageProxyProtocol(self, receivedProxyPayload, source, destination, isTCP, values=[], v6=False, sourcePort=None, destinationPort=None):
+    def checkMessageProxyProtocol(self, receivedProxyPayload, source, destination, isTCP, values=None, v6=False, sourcePort=None, destinationPort=None):
+        if values is None:
+            values = []
         proxy = ProxyProtocol()
         self.assertTrue(proxy.parseHeader(receivedProxyPayload))
         self.assertEqual(proxy.version, 0x02)