diff options
| author | Zohar Lorberbaum <zlorber@gmail.com> | 2016-03-28 10:03:26 -0700 | 
|---|---|---|
| committer | Zohar Lorberbaum <zlorber@gmail.com> | 2016-03-28 10:03:26 -0700 | 
| commit | 6d16f44ab723ef23a633b175c1cb4575919b07c4 (patch) | |
| tree | 2cf1d25543e4e81475aa97207d91a8629ce538dd /netlib/http/http1 | |
| parent | e56198ae7cf5de1d00c799133d3257434072998e (diff) | |
| download | mitmproxy-6d16f44ab723ef23a633b175c1cb4575919b07c4.tar.gz mitmproxy-6d16f44ab723ef23a633b175c1cb4575919b07c4.tar.bz2 mitmproxy-6d16f44ab723ef23a633b175c1cb4575919b07c4.zip  | |
Merge with master
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..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  | 
