diff options
author | Zohar Lorberbaum <zlorber@gmail.com> | 2016-04-28 15:09:42 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-04-28 15:09:42 -0700 |
commit | acaca765e471114f34aec25e91e00b1760d2aa75 (patch) | |
tree | f6b8efa14a92a5707b135bc172960724ff7d8baa | |
parent | 66267ad2768686f6af0ec20dfa89d1a281fc7f83 (diff) | |
download | mitmproxy-acaca765e471114f34aec25e91e00b1760d2aa75.tar.gz mitmproxy-acaca765e471114f34aec25e91e00b1760d2aa75.tar.bz2 mitmproxy-acaca765e471114f34aec25e91e00b1760d2aa75.zip |
Generate better function names for root url. (#1100)
-rw-r--r-- | mitmproxy/flow_export.py | 4 |
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: |