From 152d81fb4a194d911a5f0ce475467eb3c9eb806c Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 17 Aug 2009 20:27:05 +0200 Subject: pycurl auth fix --- module/network/Request.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'module/network/Request.py') diff --git a/module/network/Request.py b/module/network/Request.py index 11c8fae89..ea17e04e8 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -45,6 +45,7 @@ class Request: self.abort = False self.lastURL = None + self.auth = False try: if pycurl: self.curl = True @@ -162,6 +163,10 @@ class Request: return output def add_auth(self, user, pw): + + self.auth = True + self.user = user + self.pw = pw if self.curl: self.pycurl.setopt(pycurl.USERPWD, user + ":" + pw) @@ -219,6 +224,9 @@ class Request: if post: self.pycurl.setopt(pycurl.POSTFIELDS, post) + if self.auth: + self.add_auth() + if ref and self.lastURL is not None: self.pycurl.setopt(pycurl.REFERER, self.lastURL) -- cgit v1.2.3