From 0c2d894ceaefef6ae4b39c4f5a672a02672e4f8b Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 16 May 2012 15:42:58 +1200 Subject: Add the ability to flag content as missing in a request or a response. We'll use this in a number of situations. First, we'll soon have response streaming that directly pipes responses to clients. These will be content-less from mitmproxy's perspective. Second, we'll be growing new events that fire after headers are received, but before content is read. --- test/test_flow.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/test_flow.py b/test/test_flow.py index c91c456b..d9933515 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -688,6 +688,9 @@ class uRequest(libpry.AutoTree): assert r._assemble(True) + r.content = flow.CONTENT_MISSING + assert not r._assemble() + def test_getset_form_urlencoded(self): h = flow.ODictCaseless() h["content-type"] = [flow.HDR_FORM_URLENCODED] @@ -819,6 +822,9 @@ class uResponse(libpry.AutoTree): resp.request.client_conn.close = True assert "connection: close" in resp._assemble() + resp.content = flow.CONTENT_MISSING + assert not resp._assemble() + def test_refresh(self): r = tutils.tresp() n = time.time() -- cgit v1.2.3