From: Michael Tremer Date: Fri, 29 Aug 2025 22:06:47 +0000 (+0000) Subject: system: Explcitely pass request method to urllib X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52a59a717cf5b45cfdac6b9d504c18b4935d3d2a;p=ddns.git system: Explcitely pass request method to urllib This allows us to send other things except GET and POST. Signed-off-by: Michael Tremer --- diff --git a/src/ddns/system.py b/src/ddns/system.py index 8e4daf0..1999b46 100644 --- a/src/ddns/system.py +++ b/src/ddns/system.py @@ -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)