remove extra ntob to fix tests
@@ -346,12 +346,13 @@ def get(invalid_methods=('POST', 'PUT', 'DELETE'), debug=False, **kwargs):
if debug:
cherrypy.log('Reading response from cache', 'TOOLS.CACHING')
s, h, b, create_time = cache_data
- if h.get('Content-Encoding') == 'gzip' and ntob(b[0:2]) != ntob('\x1f\x8b'):
+ if h.get('Content-Encoding') == 'gzip' and b[0:2] != ntob('\x1f\x8b'):
# In some cases, a request will be cached, have its Content-Encoding header
# set to 'gzip', but is not actually gzipped. We check this scenario here,
# invalidate any cache entries, and force encoding.gzip to run.
cherrypy._cache.delete()
response.headers.pop('Content-Length', None)
+ response.headers.pop('Content-Encoding', None)
request.cached = False
request.cacheable = True
return False
