diff options
-rw-r--r-- | mitmproxy/models/http.py | 2 | ||||
-rw-r--r-- | mitmproxy/protocol/http.py | 4 | ||||
-rw-r--r-- | netlib/http/http1/assemble.py | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/mitmproxy/models/http.py b/mitmproxy/models/http.py index 428b1ba6..40460182 100644 --- a/mitmproxy/models/http.py +++ b/mitmproxy/models/http.py @@ -225,7 +225,7 @@ class HTTPResponse(MessageMixin, Response): headers: Headers object - content: Content of the request, the value is None if there is content + content: Content of the response, the value is None if there is content associated, but not present. timestamp_start: Timestamp indicating when request transmission started diff --git a/mitmproxy/protocol/http.py b/mitmproxy/protocol/http.py index 7f134efe..22e71422 100644 --- a/mitmproxy/protocol/http.py +++ b/mitmproxy/protocol/http.py @@ -50,8 +50,8 @@ class _HttpTransmissionLayer(Layer): yield "this is a generator" # pragma: no cover def send_response(self, response): - if response.content == None: - raise HttpException("Cannot assemble flow with None content") + if response.content is None: + raise HttpException("Cannot assemble flow with missing content") self.send_response_headers(response) self.send_response_body(response, [response.content]) diff --git a/netlib/http/http1/assemble.py b/netlib/http/http1/assemble.py index db5a49ce..f06ad5a1 100644 --- a/netlib/http/http1/assemble.py +++ b/netlib/http/http1/assemble.py @@ -5,8 +5,8 @@ import itertools from ...exceptions import HttpException def assemble_request(request): - if request.content == None: - raise HttpException("Cannot assemble flow with None content") + 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 @@ -19,8 +19,8 @@ def assemble_request_head(request): def assemble_response(response): - if response.content == None: - raise HttpException("Cannot assemble flow with None content") + 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 |