diff options
author | Matthew Shao <me@matshao.com> | 2016-03-26 16:00:51 +0800 |
---|---|---|
committer | Matthew Shao <me@matshao.com> | 2016-03-26 16:00:51 +0800 |
commit | 08ff00f36d49ef53b1d20d7635a74fa46a249c17 (patch) | |
tree | 89d5940b47421e5c43cd70fb9c2baf888f23645b /netlib/http/http1 | |
parent | 2f285a6015abaf75ced34231f698537ef210ffed (diff) | |
download | mitmproxy-08ff00f36d49ef53b1d20d7635a74fa46a249c17.tar.gz mitmproxy-08ff00f36d49ef53b1d20d7635a74fa46a249c17.tar.bz2 mitmproxy-08ff00f36d49ef53b1d20d7635a74fa46a249c17.zip |
replace CONTENT_MISSING with None.
Diffstat (limited to 'netlib/http/http1')
-rw-r--r-- | netlib/http/http1/assemble.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/netlib/http/http1/assemble.py b/netlib/http/http1/assemble.py index 785ee8d3..db5a49ce 100644 --- a/netlib/http/http1/assemble.py +++ b/netlib/http/http1/assemble.py @@ -3,12 +3,10 @@ from __future__ import absolute_import, print_function, division from ... import utils import itertools from ...exceptions import HttpException -from .. import CONTENT_MISSING - def assemble_request(request): - if request.content == CONTENT_MISSING: - raise HttpException("Cannot assemble flow with CONTENT_MISSING") + if request.content == None: + raise HttpException("Cannot assemble flow with None content") head = assemble_request_head(request) body = b"".join(assemble_body(request.data.headers, [request.data.content])) return head + body @@ -21,8 +19,8 @@ def assemble_request_head(request): def assemble_response(response): - if response.content == CONTENT_MISSING: - raise HttpException("Cannot assemble flow with CONTENT_MISSING") + if response.content == None: + raise HttpException("Cannot assemble flow with None content") head = assemble_response_head(response) body = b"".join(assemble_body(response.data.headers, [response.data.content])) return head + body |