From acaca765e471114f34aec25e91e00b1760d2aa75 Mon Sep 17 00:00:00 2001 From: Zohar Lorberbaum Date: Thu, 28 Apr 2016 15:09:42 -0700 Subject: Generate better function names for root url. (#1100) --- mitmproxy/flow_export.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mitmproxy/flow_export.py b/mitmproxy/flow_export.py index e2ba7161..d8e65704 100644 --- a/mitmproxy/flow_export.py +++ b/mitmproxy/flow_export.py @@ -128,7 +128,9 @@ def locust_code(flow): file_name = "_".join(components) name = re.sub('\W|^(?=\d)', '_', file_name) url = flow.request.scheme + "://" + flow.request.host + "/" + "/".join(components) - + if name == "" or name is None: + new_name = "_".join([str(flow.request.host) , str(flow.request.timestamp_start)]) + name = re.sub('\W|^(?=\d)', '_', new_name) args = "" headers = "" if flow.request.headers: -- cgit v1.2.3