From f417ec942bab9ac3999a71808b8a0a1c09fb1037 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 31 May 2011 22:18:50 +0200 Subject: no autodecode , it may break some plugins --- module/network/HTTPRequest.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'module/network/HTTPRequest.py') diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py index 87cd6a882..cc1a05852 100644 --- a/module/network/HTTPRequest.py +++ b/module/network/HTTPRequest.py @@ -180,7 +180,7 @@ class HTTPRequest(): self.lastEffectiveURL = self.c.getinfo(pycurl.EFFECTIVE_URL) self.addCookies() - rep = self.decodeResponse(rep) + #rep = self.decodeResponse(rep) return rep def verifyHeader(self): @@ -205,14 +205,19 @@ class HTTPRequest(): for line in header: line = line.lower().replace(" ", "") - if not line.startswith("content-type:") or "charset" not in line or \ + if not line.startswith("content-type:") or \ ("text" not in line and "application" not in line): continue none, delemiter, charset = line.rpartition("charset=") - charset = charset.split(";") - if charset: - encoding = charset[0] + if not delemiter: + encoding = "utf8" + else: + charset = charset.split(";") + if charset: + encoding = charset[0] + else: + encoding = "utf8" if encoding: try: -- cgit v1.2.3