summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-26 00:04:08 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-26 00:04:08 +0100
commit039503a1c8ee18e48cbbcf02faa60d1187447714 (patch)
tree80fb63db05114e66e9f1f31ab418ae317ea73cfd
parentUse rowid in the user database (diff)
downloadpyload-039503a1c8ee18e48cbbcf02faa60d1187447714.tar.xz
closed #476
-rw-r--r--module/web/middlewares.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/module/web/middlewares.py b/module/web/middlewares.py
index e0e6c3102..57023dbdb 100644
--- a/module/web/middlewares.py
+++ b/module/web/middlewares.py
@@ -90,14 +90,14 @@ class GzipResponse(object):
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:
- self.compressible = True
+
if ce:
self.compressible = False
- if self.compressible:
+ elif ct and (ct.startswith('text/') or ct.startswith('application/')) \
+ and 'zip' not in ct and 200 < cl < 1024*1024:
+ self.compressible = True
headers.append(('content-encoding', 'gzip'))
+
remove_header(headers, 'content-length')
self.headers = headers
self.status = status