(body)
| 330 | |
| 331 | |
| 332 | def decompress(body): |
| 333 | import gzip |
| 334 | |
| 335 | zbuf = io.BytesIO() |
| 336 | zbuf.write(body) |
| 337 | zbuf.seek(0) |
| 338 | zfile = gzip.GzipFile(mode='rb', fileobj=zbuf) |
| 339 | data = zfile.read() |
| 340 | zfile.close() |
| 341 | return data |
| 342 | |
| 343 | |
| 344 | def gzip(compress_level=5, mime_types=['text/html', 'text/plain'], |