def __parse_server_data(self):
"""
:return:
"""
if self.data_s2c:
try:
resp = dpkt.http.Response(self.data_s2c)
if resp.headers.get("content-encoding") == "gzip":
data = resp.body
data_arrays = mills.str2hex(data)
if data_arrays[0:3] == ["1f", "8b", "08"]:
data_unzip = gzip.GzipFile(fileobj=StringIO(data)).read()
resp.body = data_unzip
return resp
except Exception as e:
logging.error("[dpkt_http_resp_parse_failed]: %s %r" % (self.data_s2c, e))
评论列表
文章目录