diff options
Diffstat (limited to 'module/network/RequestFactory.py')
-rw-r--r-- | module/network/RequestFactory.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/module/network/RequestFactory.py b/module/network/RequestFactory.py index 90a48fe3c..e91b9ea41 100644 --- a/module/network/RequestFactory.py +++ b/module/network/RequestFactory.py @@ -54,6 +54,10 @@ class RequestFactory(): self.lock.release() return req + def getHTTPRequest(self): + """ returns a http request, dont forget to close it ! """ + return HTTPRequest(None, self.iface(), self.getProxies()) + def getURL(self, url, get={}, post={}, multipart=False): h = HTTPRequest(None, self.iface(), self.getProxies()) rep = h.load(url, get, post, multipart=multipart) @@ -76,7 +80,7 @@ class RequestFactory(): type = "http" setting = self.core.config["proxy"]["type"].lower() if setting == "socks4": type = "socks4" - if setting == "socks5": type = "socks5" + elif setting == "socks5": type = "socks5" username = None if self.core.config["proxy"]["username"] and self.core.config["proxy"]["username"].lower() != "none": @@ -103,4 +107,7 @@ class RequestFactory(): # needs pyreq in global namespace def getURL(*args, **kwargs): - return pyreq.getURL(*args, **kwargs)
\ No newline at end of file + return pyreq.getURL(*args, **kwargs) + +def getRequest(*args, **kwargs): + return pyreq.getHTTPRequest()
\ No newline at end of file |