summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-26 22:45:13 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-26 22:45:13 +0100
commit4690417077a7374c99ed980430f44b829296ed26 (patch)
tree5998665d9344e7991b0d53cb9edf45ba15355fad
parentgui contaoner upload, closes #39 (diff)
downloadpyload-4690417077a7374c99ed980430f44b829296ed26.tar.xz
fixed rs auth (pycurl doesn't like unicode)
-rwxr-xr-xmodule/network/Request.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/module/network/Request.py b/module/network/Request.py
index c6d6f0901..d1280f591 100755
--- a/module/network/Request.py
+++ b/module/network/Request.py
@@ -207,13 +207,14 @@ class Request:
self.auth = True
self.user = user
self.pw = pw
-
+
+ upwstr = str("%s:%s" % (user,pw))
if self.curl:
- self.pycurl.setopt(pycurl.HTTPHEADER, ['Authorization: Basic ' + base64.encodestring(user + ':' + pw)[:-1]])
- self.pycurl.setopt(pycurl.USERPWD, user + ":" + pw)
+ self.pycurl.setopt(pycurl.HTTPHEADER, ['Authorization: Basic ' + base64.encodestring(upwstr)[:-1]])
+ self.pycurl.setopt(pycurl.USERPWD, upwstr)
self.pycurl.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_ANY)
else:
- self.downloader.addheaders.append(['Authorization', 'Basic ' + base64.encodestring(user + ':' + pw)[:-1]])
+ self.downloader.addheaders.append(['Authorization', 'Basic ' + base64.encodestring(upwstr)[:-1]])
def add_cookies(self, req):
cookie_head = ""