From ee75a0b9cbe5f4882453d2f1cb0d0a7df431200a Mon Sep 17 00:00:00 2001 From: Marcelo Glezer Date: Wed, 14 Jan 2015 12:03:40 -0300 Subject: now content and header are working and exception for binary files are handled correctly --- libmproxy/protocol/http.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'libmproxy/protocol/http.py') diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 04e3fe40..63f9e47b 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -954,20 +954,18 @@ class HTTPFlow(Flow): return c def response_content(self): - s = "[No Content]" with decoded(self.response): s = self.response.content + if s == None: + s = "[No content]" return s def response_headers(self): with decoded(self.response): - sh = "" - for i in self.flow.response.headers: - v = self.flow.response.headers[i] - for j in v: - sh += str(i)+"="+str(v[j])+"\n" - return sh - + s = str(self.response.headers) + if s == None: + s = "[]" + return s class HttpAuthenticationError(Exception): def __init__(self, auth_headers=None): -- cgit v1.2.3