diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-05-16 15:42:58 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-05-16 15:42:58 +1200 |
commit | 0c2d894ceaefef6ae4b39c4f5a672a02672e4f8b (patch) | |
tree | d150a3029f7cf846973a38eaeb1b7739ebdfc056 /test | |
parent | 12b8a43dbe433adb2f713560ef6fd13b83bc13ee (diff) | |
download | mitmproxy-0c2d894ceaefef6ae4b39c4f5a672a02672e4f8b.tar.gz mitmproxy-0c2d894ceaefef6ae4b39c4f5a672a02672e4f8b.tar.bz2 mitmproxy-0c2d894ceaefef6ae4b39c4f5a672a02672e4f8b.zip |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_flow.py | 6 |
1 files changed, 6 insertions, 0 deletions
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() |