aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol/http.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/protocol/http.py')
-rw-r--r--libmproxy/protocol/http.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py
index 49f5e8c0..d3945579 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):