aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZohar Lorberbaum <zlorber@gmail.com>2016-04-28 15:09:42 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-04-28 15:09:42 -0700
commitacaca765e471114f34aec25e91e00b1760d2aa75 (patch)
treef6b8efa14a92a5707b135bc172960724ff7d8baa
parent66267ad2768686f6af0ec20dfa89d1a281fc7f83 (diff)
downloadmitmproxy-acaca765e471114f34aec25e91e00b1760d2aa75.tar.gz
mitmproxy-acaca765e471114f34aec25e91e00b1760d2aa75.tar.bz2
mitmproxy-acaca765e471114f34aec25e91e00b1760d2aa75.zip
Generate better function names for root url. (#1100)
-rw-r--r--mitmproxy/flow_export.py4
1 files changed, 3 insertions, 1 deletions
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: