mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
Remove raw_request exporter
This functionality will be handled by headers+content
This commit is contained in:
parent
3ae28f1c31
commit
8f4d49e22a
@ -97,11 +97,6 @@ def python_code(flow):
|
||||
return code
|
||||
|
||||
|
||||
def raw_request(flow):
|
||||
data = netlib.http.http1.assemble_request(flow.request)
|
||||
return _native(data)
|
||||
|
||||
|
||||
def is_json(headers, content):
|
||||
# type: (netlib.http.Headers, bytes) -> bool
|
||||
if headers:
|
||||
@ -202,7 +197,6 @@ def locust_task(flow):
|
||||
EXPORTERS = [
|
||||
("as curl command", "c", curl_command),
|
||||
("as python code", "p", python_code),
|
||||
("as raw request", "r", raw_request),
|
||||
("as locust code", "l", locust_code),
|
||||
("as locust task", "t", locust_task),
|
||||
]
|
||||
|
@ -1,4 +1,3 @@
|
||||
from textwrap import dedent
|
||||
import re
|
||||
|
||||
import netlib.tutils
|
||||
@ -70,41 +69,6 @@ class TestExportPythonCode():
|
||||
python_equals("data/test_flow_export/python_patch.py", export.python_code(flow))
|
||||
|
||||
|
||||
class TestRawRequest():
|
||||
def test_get(self):
|
||||
flow = tutils.tflow(req=req_get())
|
||||
result = dedent("""
|
||||
GET /path?a=foo&a=bar&b=baz HTTP/1.1\r
|
||||
header: qvalue\r
|
||||
content-length: 7\r
|
||||
host: address:22\r
|
||||
\r
|
||||
""").strip(" ").lstrip()
|
||||
assert export.raw_request(flow) == result
|
||||
|
||||
def test_post(self):
|
||||
flow = tutils.tflow(req=req_post())
|
||||
result = dedent("""
|
||||
POST /path HTTP/1.1\r
|
||||
host: address:22\r
|
||||
\r
|
||||
content
|
||||
""").strip()
|
||||
assert export.raw_request(flow) == result
|
||||
|
||||
def test_patch(self):
|
||||
flow = tutils.tflow(req=req_patch())
|
||||
result = dedent("""
|
||||
PATCH /path?query=param HTTP/1.1\r
|
||||
header: qvalue\r
|
||||
content-length: 7\r
|
||||
host: address:22\r
|
||||
\r
|
||||
content
|
||||
""").strip()
|
||||
assert export.raw_request(flow) == result
|
||||
|
||||
|
||||
class TestExportLocustCode():
|
||||
def test_get(self):
|
||||
flow = tutils.tflow(req=req_get())
|
||||
|
Loading…
Reference in New Issue
Block a user