aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_export_flow.py
diff options
context:
space:
mode:
authorShadab Zafar <dufferzafar0@gmail.com>2016-02-08 23:31:56 +0530
committerShadab Zafar <dufferzafar0@gmail.com>2016-02-08 23:31:56 +0530
commitae8fb0a3d39cf71cb43b30622304aba992e7580f (patch)
tree6624eafeaa6fc1b609419f8b58739115215680e5 /test/test_export_flow.py
parent56892f885b1a306e5f78226c7b7caabccaa5ebcd (diff)
downloadmitmproxy-ae8fb0a3d39cf71cb43b30622304aba992e7580f.tar.gz
mitmproxy-ae8fb0a3d39cf71cb43b30622304aba992e7580f.tar.bz2
mitmproxy-ae8fb0a3d39cf71cb43b30622304aba992e7580f.zip
Fix content length header issues
Caused by: https://github.com/mitmproxy/netlib/commit/d253ebc142d80708a1bdc065d3db05d1394e3819
Diffstat (limited to 'test/test_export_flow.py')
-rw-r--r--test/test_export_flow.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/test_export_flow.py b/test/test_export_flow.py
index d026e214..7bd7a442 100644
--- a/test/test_export_flow.py
+++ b/test/test_export_flow.py
@@ -20,7 +20,7 @@ req_patch = netlib.tutils.treq(
def test_curl_command():
flow = tutils.tflow(req=req_get)
- result = """curl -H 'header:qvalue' 'http://address/path'"""
+ result = """curl -H 'header:qvalue' -H 'content-length:7' 'http://address/path'"""
assert flow_export.curl_command(flow) == result
flow = tutils.tflow(req=req_post)
@@ -28,7 +28,7 @@ def test_curl_command():
assert flow_export.curl_command(flow) == result
flow = tutils.tflow(req=req_patch)
- result = """curl -H 'header:qvalue' -X PATCH 'http://address/path?query=param' --data-binary 'content'"""
+ result = """curl -H 'header:qvalue' -H 'content-length:7' -X PATCH 'http://address/path?query=param' --data-binary 'content'"""
assert flow_export.curl_command(flow) == result
@@ -38,6 +38,7 @@ def test_python_code():
"""url = 'http://address/path'\n\n"""
"""headers = {\n"""
""" 'header': 'qvalue',\n"""
+ """ 'content-length': '7',\n"""
"""}\n\n"""
"""response = requests.request(\n"""
""" method='GET',\n"""
@@ -63,6 +64,7 @@ def test_python_code():
"""url = 'http://address/path'\n\n"""
"""headers = {\n"""
""" 'header': 'qvalue',\n"""
+ """ 'content-length': '7',\n"""
"""}\n\n"""
"""params = {\n"""
""" 'query': 'param',\n"""
@@ -83,6 +85,7 @@ def test_raw_request():
flow = tutils.tflow(req=req_get)
result = ("""GET /path HTTP/1.1\r\n"""
"""header: qvalue\r\n"""
+ """content-length: 7\r\n"""
"""host: address:22\r\n\r\n"""
"""""")
assert flow_export.raw_request(flow) == result
@@ -96,6 +99,7 @@ def test_raw_request():
flow = tutils.tflow(req=req_patch)
result = ("""PATCH /path?query=param HTTP/1.1\r\n"""
"""header: qvalue\r\n"""
+ """content-length: 7\r\n"""
"""host: address:22\r\n\r\n"""
"""content""")
assert flow_export.raw_request(flow) == result