Auto-replace double question marks in request url.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 14 Jun 2014 21:21:14 +0000 (23:21 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sat, 14 Jun 2014 21:56:32 +0000 (23:56 +0200)
src/ddns/system.py

index 08df265..baa80a1 100644 (file)
@@ -100,7 +100,10 @@ class DDNSSystem(object):
                        query_args = self._format_query_args(data)
                        data = None
 
-                       url = "%s?%s" % (url, query_args)
+                       if "?" in url:
+                               url = "%s&%s" % (url, query_args)
+                       else:
+                               url = "%s?%s" % (url, query_args)
 
                logger.debug("Sending request (%s): %s" % (method, url))
                if data: