summaryrefslogtreecommitdiffstats
path: root/module/network/HTTPRequest.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/network/HTTPRequest.py')
-rw-r--r--module/network/HTTPRequest.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py
index ffe5d1873..6672a58e6 100644
--- a/module/network/HTTPRequest.py
+++ b/module/network/HTTPRequest.py
@@ -55,7 +55,7 @@ class HTTPRequest():
self.headers = [] #temporary request header
self.initHandle()
- self.setInterface(options["interface"], options["proxies"], options["ipv6"])
+ self.setInterface(options)
self.c.setopt(pycurl.WRITEFUNCTION, self.write)
self.c.setopt(pycurl.HEADERFUNCTION, self.writeHeader)
@@ -89,7 +89,10 @@ class HTTPRequest():
"Keep-Alive: 300",
"Expect:"])
- def setInterface(self, interface, proxy, ipv6=False):
+ def setInterface(self, options):
+
+ interface, proxy, ipv6 = options["interface"], options["proxies"], options["ipv6"]
+
if interface and interface.lower() != "none":
self.c.setopt(pycurl.INTERFACE, str(interface))
@@ -112,6 +115,9 @@ class HTTPRequest():
else:
self.c.setopt(pycurl.IPRESOLVE, pycurl.IPRESOLVE_V4)
+ if "auth" in options:
+ self.c.setopt(pycurl.USERPWD, str(options["auth"]))
+
def addCookies(self):
""" put cookies from curl handle to cj """
if self.cj: