diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-03-31 18:07:58 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-03-31 18:07:58 +0200 |
commit | c788e18e03e22bccb7c08eb7ac8283f3732aa50d (patch) | |
tree | 6cd4f99c6570a5c4e7f00a48f91cba147c5b4974 /netlib/http/http1/assemble.py | |
parent | 5552b5e782deaa510ebb00f337e39e99ac452aae (diff) | |
parent | de0f2cbcd349005a07679283befa2d209bd9d022 (diff) | |
download | mitmproxy-c788e18e03e22bccb7c08eb7ac8283f3732aa50d.tar.gz mitmproxy-c788e18e03e22bccb7c08eb7ac8283f3732aa50d.tar.bz2 mitmproxy-c788e18e03e22bccb7c08eb7ac8283f3732aa50d.zip |
Merge branch 'master' of https://github.com/mitmproxy/mitmproxy
Diffstat (limited to 'netlib/http/http1/assemble.py')
-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..f06ad5a1 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 is None: + raise HttpException("Cannot assemble flow with missing 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 is None: + raise HttpException("Cannot assemble flow with missing content") head = assemble_response_head(response) body = b"".join(assemble_body(response.data.headers, [response.data.content])) return head + body |