From ed8249023fb7c0d429b9278c63b51ac071700987 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 26 Nov 2014 04:18:21 +0100 Subject: introduce revised views, port over changes from multiple_views branch --- libmproxy/protocol/http.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libmproxy/protocol') diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 26a94040..b32a55ed 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -117,7 +117,10 @@ class HTTPMessage(stateobject.StateObject): def get_state(self, short=False): ret = super(HTTPMessage, self).get_state(short) if short: - ret["contentLength"] = len(self.content) + if self.content: + ret["contentLength"] = len(self.content) + else: + ret["contentLength"] = 0 return ret def get_decoded_content(self): -- cgit v1.2.3