Lines Matching refs:gzip
52 # 2014-12-02 ch/doko Add workaround for gzip bomb vulnerability
142 import gzip
144 gzip = None #python can be built without zlib/gzip support
1034 # Encode a string using the gzip content encoding such as specified by the
1035 # Content-Encoding: gzip
1042 """data -> gzip encoded data
1044 Encode data using the gzip content encoding as described in RFC 1952
1046 if not gzip:
1049 with gzip.GzipFile(mode="wb", fileobj=f, compresslevel=1) as gzf:
1054 # Decode a string using the gzip content encoding such as specified by the
1055 # Content-Encoding: gzip
1066 """gzip encoded data -> unencoded data
1068 Decode data using the gzip content encoding as described in RFC 1952
1070 if not gzip:
1072 with gzip.GzipFile(mode="rb", fileobj=BytesIO(data)) as gzf:
1085 # Return a decoded file-like object for the gzip encoding
1091 class GzipDecodedResponse(gzip.GzipFile if gzip else object):
1092 """a file-like object to decode a response encoded with the gzip
1098 if not gzip:
1101 gzip.GzipFile.__init__(self, mode="rb", fileobj=self.io)
1105 gzip.GzipFile.close(self)
1136 #if true, we'll request gzip encoding
1139 # if positive, encode request using gzip if it exceeds this threshold
1283 if self.accept_gzip_encoding and gzip:
1285 headers.append(("Accept-Encoding", "gzip"))
1316 gzip):
1317 connection.putheader("Content-Encoding", "gzip")
1333 if response.getheader("Content-Encoding", "") == "gzip":