From 4690417077a7374c99ed980430f44b829296ed26 Mon Sep 17 00:00:00 2001 From: mkaay Date: Sat, 26 Dec 2009 22:45:13 +0100 Subject: fixed rs auth (pycurl doesn't like unicode) --- module/network/Request.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/network/Request.py') 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 = "" -- cgit v1.2.3