]> git.ipfire.org Git - ddns.git/commitdiff
system: Explcitely pass request method to urllib
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 29 Aug 2025 22:06:47 +0000 (22:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 29 Aug 2025 22:06:47 +0000 (22:06 +0000)
This allows us to send other things except GET and POST.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/ddns/system.py

index 8e4daf0d6791dc7c37b0c6c93ff8557abf87c35f..1999b46252b052e535ffe774a44a60464ed9e323 100644 (file)
@@ -124,8 +124,6 @@ class DDNSSystem(object):
 
        def send_request(self, url, method="GET", data=None, username=None, password=None,
                        timeout=30, expect=bytes):
-               assert method in ("GET", "POST")
-
                # Add all arguments in the data dict to the URL and escape them properly
                if data:
                        if method == "GET":
@@ -145,7 +143,7 @@ class DDNSSystem(object):
                if data:
                        logger.debug("  data: %s" % data)
 
-               req = urllib.request.Request(url, data=data)
+               req = urllib.request.Request(url, method=method, data=data)
 
                if username and password:
                        basic_auth_header = self._make_basic_auth_header(username, password)