diff options
Diffstat (limited to 'cherrypy/lib/encoding.py')
-rw-r--r-- | cherrypy/lib/encoding.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cherrypy/lib/encoding.py b/cherrypy/lib/encoding.py index 095ab2ae..d5886af1 100644 --- a/cherrypy/lib/encoding.py +++ b/cherrypy/lib/encoding.py @@ -195,7 +195,6 @@ def compress(body, compress_level): # ISIZE: 4 bytes yield struct.pack("<L", size & 0xFFFFFFFFL) - def decompress(body): import gzip from cherrypy.py3util import StringIO @@ -256,7 +255,7 @@ def gzip(compress_level=5, mime_types=['text/html', 'text/plain']): # Return a generator that compresses the page response.headers['Content-Encoding'] = 'gzip' response.body = compress(response.body, compress_level) - if response.headers.has_key("Content-Length"): + if "Content-Length" in response.headers: # Delete Content-Length header so finalize() recalcs it. del response.headers["Content-Length"] return |