summaryrefslogtreecommitdiffstats
path: root/module/network/HTTPChunk.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-04-24 19:46:59 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-04-24 19:46:59 +0200
commit1ef8f2435ec72fac64505fc11939e94665e11eef (patch)
tree76eb662a771923479e894b9c160a9b46326f33d1 /module/network/HTTPChunk.py
parentbitshare fixes (diff)
downloadpyload-1ef8f2435ec72fac64505fc11939e94665e11eef.tar.xz
parse content disposition
Diffstat (limited to 'module/network/HTTPChunk.py')
-rw-r--r--module/network/HTTPChunk.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py
index 2fc48a588..a88d94afe 100644
--- a/module/network/HTTPChunk.py
+++ b/module/network/HTTPChunk.py
@@ -226,11 +226,16 @@ class HTTPChunk(HTTPRequest):
def parseHeader(self):
"""parse data from recieved header"""
- for line in self.header.splitlines():
- line = line.strip().lower()
+ for orgline in self.header.splitlines():
+ line = orgline.strip().lower()
if line.startswith("accept-ranges") and "bytes" in line:
self.p.chunkSupport = True
+ if line.startswith("content-disposition") and "filename=" in line:
+ name = orgline.partition("filename=")[2]
+ name = name.replace('"', "").replace("'", "").replace(";", "").strip()
+ self.p.nameDisposition = name
+
if not self.resume and line.startswith("content-length"):
self.p.size = int(line.split(":")[1])