From b0ab80452769af1482e679db93abd407c608a7f6 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 13 Mar 2011 18:48:01 +0100 Subject: cnl fix --- module/web/cnl_app.py | 6 +++--- module/web/middlewares.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'module/web') diff --git a/module/web/cnl_app.py b/module/web/cnl_app.py index 4c8b3ed4c..f46893388 100644 --- a/module/web/cnl_app.py +++ b/module/web/cnl_app.py @@ -31,7 +31,7 @@ def local_check(function): @route("/flash", method="POST") @local_check def flash(id="0"): - return "JDownloader" + return "JDownloader\r\n" @route("/flash/add", method="POST") @local_check @@ -60,7 +60,7 @@ def addcrypted(): except: return HTTPError() else: - return "success" + return "success\r\n" @route("/flash/addcrypted2", method="POST") @local_check @@ -106,7 +106,7 @@ def addcrypted2(): except: return "failed can't add" else: - return "success" + return "success\r\n" @route("/flashgot", method="POST") @local_check diff --git a/module/web/middlewares.py b/module/web/middlewares.py index 745d7e6b5..f8b2ed976 100644 --- a/module/web/middlewares.py +++ b/module/web/middlewares.py @@ -85,9 +85,10 @@ 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')) self.compressible = False if ct and (ct.startswith('text/') or ct.startswith('application/')) \ - and 'zip' not in ct: + and 'zip' not in ct and cl > 200: self.compressible = True if ce: self.compressible = False -- cgit v1.2.3