mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
Add a url exporter
This commit is contained in:
parent
0d478e71ee
commit
c84d0bd10b
@ -194,6 +194,10 @@ def locust_task(flow):
|
|||||||
return task_code
|
return task_code
|
||||||
|
|
||||||
|
|
||||||
|
def url(flow):
|
||||||
|
return flow.request.url
|
||||||
|
|
||||||
|
|
||||||
EXPORTERS = [
|
EXPORTERS = [
|
||||||
("content", "c"),
|
("content", "c"),
|
||||||
("headers+content", "h"),
|
("headers+content", "h"),
|
||||||
|
@ -117,3 +117,9 @@ class TestIsJson():
|
|||||||
headers = Headers(content_type="application/json")
|
headers = Headers(content_type="application/json")
|
||||||
j = export.is_json(headers, b'{"name": "example", "email": "example@example.com"}')
|
j = export.is_json(headers, b'{"name": "example", "email": "example@example.com"}')
|
||||||
assert isinstance(j, dict)
|
assert isinstance(j, dict)
|
||||||
|
|
||||||
|
|
||||||
|
class TestURL():
|
||||||
|
def test_url(self):
|
||||||
|
flow = tutils.tflow()
|
||||||
|
assert export.url(flow) == "http://address:22/path"
|
||||||
|
Loading…
Reference in New Issue
Block a user