Lines Matching full:gzip
52 # 2014-12-02 ch/doko Add workaround for gzip bomb vulnerability
147 import gzip
149 gzip = None #python can be built without zlib/gzip support
1149 # Encode a string using the gzip content encoding such as specified by the
1150 # Content-Encoding: gzip
1157 """data -> gzip encoded data
1159 Encode data using the gzip content encoding as described in RFC 1952
1161 if not gzip:
1164 gzf = gzip.GzipFile(mode="wb", fileobj=f, compresslevel=1)
1172 # Decode a string using the gzip content encoding such as specified by the
1173 # Content-Encoding: gzip
1184 """gzip encoded data -> unencoded data
1186 Decode data using the gzip content encoding as described in RFC 1952
1188 if not gzip:
1191 gzf = gzip.GzipFile(mode="rb", fileobj=f)
1206 # Return a decoded file-like object for the gzip encoding
1212 class GzipDecodedResponse(gzip.GzipFile if gzip else object):
1213 """a file-like object to decode a response encoded with the gzip
1219 if not gzip:
1222 gzip.GzipFile.__init__(self, mode="rb", fileobj=self.stringio)
1226 gzip.GzipFile.close(self)
1257 #if true, we'll request gzip encoding
1260 # if positive, encode request using gzip if it exceeds this threshold
1410 if (self.accept_gzip_encoding and gzip):
1412 connection.putheader("Accept-Encoding", "gzip")
1454 gzip):
1455 connection.putheader("Content-Encoding", "gzip")
1472 if response.getheader("Content-Encoding", "") == "gzip":