过滤响应内容非json的接口录制

This commit is contained in:
zy7y 2021-05-27 09:31:42 +08:00
parent e6e5db3ddb
commit aa09f3a945
2 changed files with 3 additions and 3 deletions

View File

@ -52,5 +52,5 @@ class ReadFile:
if table.cell_value(norw, 4) != '': # 每行第4列等于否将不读取内容
value = table.row_values(norw)
value.pop(4)
data_list.append(list(value))
data_list.append(value)
return data_list

View File

@ -48,11 +48,11 @@ class Counter:
def response(self, flow: mitmproxy.http.HTTPFlow):
"""
mitmproxy抓包处理响应在这里汇总需要数据
mitmproxy抓包处理响应在这里汇总需要数据, 过滤 包含指定url并且响应格式是 json的
:param flow:
:return:
"""
if self.url in flow.request.url:
if self.url in flow.request.url and 'json' in flow.response.headers["Content-Type"]:
# 编号
number = "C" + str(self.counter)
# 标题