summaryrefslogtreecommitdiffstats
path: root/module/network/HTTPRequest.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-11-04 20:40:09 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-11-04 20:40:09 +0100
commit138c28777f8a09fd88c4002a00c87e8bd0c7be74 (patch)
tree5d8aea3a8dbc65276dc04722e62375ce6dc61b6a /module/network/HTTPRequest.py
parentBasePlugin: attempt to fix #266 (diff)
downloadpyload-138c28777f8a09fd88c4002a00c87e8bd0c7be74.tar.xz
closed #418
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: