diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-03-13 18:56:02 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-03-13 18:56:02 +0100 |
commit | b2ac275cba8b9f46864ad07f50a1db485bcb6f43 (patch) | |
tree | b6994d3aced0a0ebe808225baf2e9cbae0fcf50e /module | |
parent | cnl fix (diff) | |
download | pyload-b2ac275cba8b9f46864ad07f50a1db485bcb6f43.tar.xz |
fixed gzip
Diffstat (limited to 'module')
-rw-r--r-- | module/network/HTTPDownload.py | 2 | ||||
-rw-r--r-- | module/web/middlewares.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py index c43d714ef..ad6312508 100644 --- a/module/network/HTTPDownload.py +++ b/module/network/HTTPDownload.py @@ -102,7 +102,7 @@ class HTTPDownload(): fo.close() remove(init) self.info.remove() #there are probably invalid chunks - raise Exception("Downloaded content was smaller than expected") + raise Exception("Downloaded content was smaller than expected. Try to reduce download connections.") remove(fname) #remove chunk fo.close() diff --git a/module/web/middlewares.py b/module/web/middlewares.py index f8b2ed976..b71138e69 100644 --- a/module/web/middlewares.py +++ b/module/web/middlewares.py @@ -85,7 +85,11 @@ class GzipResponse(object): self.headers = headers ct = header_value(headers,'content-type') ce = header_value(headers,'content-encoding') - cl = int(header_value(headers, 'content-length')) + cl = header_value(headers, 'content-length') + if cl: + cl = int(cl) + else: + cl = 201 self.compressible = False if ct and (ct.startswith('text/') or ct.startswith('application/')) \ and 'zip' not in ct and cl > 200: |