mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +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
|
||||
|
||||
|
||||
def url(flow):
|
||||
return flow.request.url
|
||||
|
||||
|
||||
EXPORTERS = [
|
||||
("content", "c"),
|
||||
("headers+content", "h"),
|
||||
|
@ -117,3 +117,9 @@ class TestIsJson():
|
||||
headers = Headers(content_type="application/json")
|
||||
j = export.is_json(headers, b'{"name": "example", "email": "example@example.com"}')
|
||||
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