summaryrefslogtreecommitdiffstats
path: root/module/network/HTTPRequest.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-03-11 23:41:40 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-03-11 23:41:40 +0100
commitb692dc0ba8e8940844eb647a1f15e435a55ce4eb (patch)
tree1653344e5b37504894fe2c2e226f9d8d094bd3bb /module/network/HTTPRequest.py
parentfixed DepositFile free (diff)
downloadpyload-b692dc0ba8e8940844eb647a1f15e435a55ce4eb.tar.xz
closed #259, #250
Diffstat (limited to 'module/network/HTTPRequest.py')
-rw-r--r--module/network/HTTPRequest.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py
index 42b7aaf51..cd3635bcf 100644
--- a/module/network/HTTPRequest.py
+++ b/module/network/HTTPRequest.py
@@ -47,6 +47,8 @@ class HTTPRequest():
self.header = ""
+ self.headers = [] #temporary request header
+
self.initHandle()
self.setInterface(interface, proxies)
@@ -150,7 +152,8 @@ class HTTPRequest():
self.header = ""
- #@TODO raw_cookies and some things in old backend, which are apperently not needed
+ if self.headers:
+ self.c.setopt(pycurl.HTTPHEADER, self.headers)
if just_header:
self.c.setopt(pycurl.NOBODY, 1)
@@ -165,6 +168,8 @@ class HTTPRequest():
self.lastEffectiveURL = self.c.getinfo(pycurl.EFFECTIVE_URL)
self.addCookies()
+ self.headers = []
+
return rep
def verifyHeader(self):
@@ -198,6 +203,12 @@ class HTTPRequest():
""" writes header """
self.header += buf
+ def putHeader(self, name, value):
+ self.headers.append("%s: %s" % (name, value))
+
+ def clearHeaders(self):
+ self.headers = []
+
def close(self):
""" cleanup, unusable after this """
self.rep.close()