From 85e725dc5a381c53b80b0c479de5b21416fbd3fd Mon Sep 17 00:00:00 2001 From: fragonib Date: Mon, 2 May 2011 16:13:24 +0200 Subject: BitshareCom: I18N issues, HTTPRequest: Prevent follow redirection with just_header --- module/network/HTTPRequest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/network/HTTPRequest.py') diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py index fa088391a..f0a80fd93 100644 --- a/module/network/HTTPRequest.py +++ b/module/network/HTTPRequest.py @@ -156,6 +156,8 @@ class HTTPRequest(): self.c.setopt(pycurl.HTTPHEADER, self.headers) if just_header: + self.c.setopt(pycurl.FOLLOWLOCATION, 0) + self.c.setopt(pycurl.HEADER, 1) self.c.setopt(pycurl.NOBODY, 1) self.c.perform() rep = self.header @@ -188,7 +190,7 @@ class HTTPRequest(): def write(self, buf): """ writes response """ - if self.rep.tell() > 500000 or self.abort: + if self.rep.tell() > 1000000 or self.abort: rep = self.getResponse() if self.abort: raise Abort() f = open("response.dump", "wb") -- cgit v1.2.3