diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-04-24 19:46:59 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-04-24 19:46:59 +0200 |
commit | 1ef8f2435ec72fac64505fc11939e94665e11eef (patch) | |
tree | 76eb662a771923479e894b9c160a9b46326f33d1 /module/network/HTTPChunk.py | |
parent | bitshare fixes (diff) | |
download | pyload-1ef8f2435ec72fac64505fc11939e94665e11eef.tar.xz |
parse content disposition
Diffstat (limited to 'module/network/HTTPChunk.py')
-rw-r--r-- | module/network/HTTPChunk.py | 9 |
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]) |