summaryrefslogtreecommitdiffstats
path: root/pyload/network
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-02 00:59:57 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-02 00:59:57 +0100
commit80bfea9340f8ca3b5a2e4ebcb803674e8f3c1a76 (patch)
tree8bbb44c0e82f4e6b27be2fe1b6c483e6a8ec84c7 /pyload/network
parentMerge branch 'pr/n936_kmarty' into 0.4.10 (diff)
downloadpyload-80bfea9340f8ca3b5a2e4ebcb803674e8f3c1a76.tar.xz
Tiny code cosmetics
Diffstat (limited to 'pyload/network')
-rw-r--r--pyload/network/HTTPChunk.py9
1 files changed, 5 insertions, 4 deletions
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")