compress wiki text, only decompress if compressed

This commit is contained in:
j 2017-03-14 19:11:52 +01:00
parent 1dc2788c25
commit dc2eaccd92

View file

@ -32,6 +32,7 @@ COMPRESS_TYPES = (
'text/html',
'text/plain',
'text/xml',
'text/x-wiki',
'application/json',
'application/xhtml+xml',
'application/x-javascript',
@ -399,9 +400,9 @@ class KVCache(Cache):
if value == 'headers':
r = info['headers']
else:
data = self.backend.get(data_key)
if data:
r = zlib.decompress(data)
r = self.backend.get(data_key)
if r and info['compressed']:
r = zlib.decompress(r)
return r
def delete(self, url, data=None, headers=None):