diff options
Diffstat (limited to 'module/network/HTTPRequest.py')
-rw-r--r-- | module/network/HTTPRequest.py | 13 |
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() |