diff options
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: | 
