diff options
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]) |