From 80bfea9340f8ca3b5a2e4ebcb803674e8f3c1a76 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 2 Dec 2014 00:59:57 +0100 Subject: Tiny code cosmetics --- pyload/network/HTTPChunk.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'pyload') diff --git a/pyload/network/HTTPChunk.py b/pyload/network/HTTPChunk.py index a4702e677..f7f1d1b08 100644 --- a/pyload/network/HTTPChunk.py +++ b/pyload/network/HTTPChunk.py @@ -253,6 +253,7 @@ class HTTPChunk(HTTPRequest): """parse data from recieved header""" for orgline in self.decodeResponse(self.header).splitlines(): line = orgline.strip().lower() + if line.startswith("accept-ranges") and "bytes" in line: self.p.chunkSupport = True @@ -265,8 +266,10 @@ class HTTPChunk(HTTPRequest): else: # basic version, US-ASCII only name = orgline.partition("filename=")[2] + name = name.replace('"', "").replace("'", "").replace(";", "").replace("/", "_").strip() self.p.nameDisposition = name + self.log.debug("Content-Disposition: %s" % name) if not self.resume and line.startswith("content-length"): @@ -301,7 +304,5 @@ class HTTPChunk(HTTPRequest): def charEnc(enc): - return { - 'utf-8': 'utf_8', - 'iso-8859-1': 'latin_1', - }.get(enc, 'unknown') + return {'utf-8' : "utf_8", + 'iso-8859-1': "latin_1"}.get(enc, "unknown") -- cgit v1.2.3