mitmproxy/test
Aldo Cortesi 16654ad6a4 Fix crash while streaming
Found using fuzzing. Reproduction with pathoc, given "mitmproxy -s" and
pathod running on 9999:

get:'http://localhost:9999/p/':s'200:b\'foo\':h\'Content-Length\'=\'3\'':i58,'\x1a':r

 return flow.FlowMaster.run(self)
   File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/controller.py", line 111, in run
     self.tick(self.masterq, 0.01)
   File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/flow.py", line 613, in tick
     return controller.Master.tick(self, q, timeout)
   File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/controller.py", line 101, in tick
     self.handle(*msg)
   File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/controller.py", line 118, in handle
     m(obj)
   File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/flow.py", line 738, in handle_responseheaders
     self.stream_large_bodies.run(f, False)
   File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/flow.py", line 155, in run
     r.headers, is_request, flow.request.method, code
   File "/Users/aldo/mitmproxy/mitmproxy/netlib/http.py", line 401, in expected_http_body_size
     raise HttpError(400 if is_request else 502, "Invalid content-length header: %s" % headers["content-length"])
 netlib.http.HttpError: Invalid content-length header: ['\x1a3']
2014-10-26 17:58:36 +13:00
..
completion Fine-tune completion a bit. 2011-02-03 13:50:57 +13:00
data added unit test update. coverage still at 97% 2014-07-01 16:33:48 -07:00
fuzzing Fix crash while streaming 2014-10-26 17:58:36 +13:00
scripts simplify responseheader scripthook 2014-07-20 11:17:53 +02:00
tools add test case for #375 2014-10-17 17:08:41 +02:00
mock_urwid.py mock urwid to run console tests on windows, push failing testcases down to 0. :-) 2014-02-05 23:17:26 +01:00
test_app.py Revert to old cert names, use a subdir for test conf dir. 2014-03-07 16:38:24 +13:00
test_cmdline.py add advanced proxying options, add SSL-terminating capability to mitmproxy 2014-03-10 05:11:51 +01:00
test_console_common.py fix #341 - work on flows instead of request/response internally. 2014-09-03 16:57:56 +02:00
test_console_contentview.py fix linux tests... 2014-03-13 01:30:26 +01:00
test_console_help.py update tests to reflect changes to options.scripts 2013-06-17 16:48:06 +02:00
test_console_search.py fix windows tests, include improvements from 0.10.1 2014-03-08 17:19:47 +01:00
test_console.py fix #341 - work on flows instead of request/response internally. 2014-09-03 16:57:56 +02:00
test_controller.py Decouple message type from message class name. 2014-01-04 14:42:32 +13:00
test_dump.py mitmproxy -> libmproxy.main. do some leanup on the way 2014-09-08 23:34:43 +02:00
test_encoding.py Port mitmproxy test suite entirely to nose. 2012-06-09 13:42:43 +12:00
test_examples.py fix tests 2014-09-12 03:16:52 +02:00
test_filt.py fix #307 2014-08-03 02:34:29 +02:00
test_flow.py fix #346 2014-10-22 14:03:19 +02:00
test_fuzzing.py Achievement Unlocked: Proxy Chain 2014-02-07 07:08:59 +01:00
test_platform_pf.py adjust tests 2014-08-10 16:20:04 +02:00
test_protocol_http.py update docs, mostly revert 2f44b26b4c 2014-09-05 15:16:20 +02:00
test_proxy.py mitmproxy -> libmproxy.main. do some leanup on the way 2014-09-08 23:34:43 +02:00
test_script.py change replay_request behaviour, refs #346; test upstream proxy mode 2014-09-05 00:18:17 +02:00
test_server.py fix race conditions in tests 2014-10-19 01:26:08 +02:00
test_utils.py suppress SPDY/HTTP2 announcement headers, fix #277 2014-08-03 16:25:38 +02:00
tservers.py Remove external app option, make tick timeout explicit 2014-09-14 11:46:01 +12:00
tutils.py Clean up and clarify StateObject 2014-09-17 11:41:42 +12:00