diff options
author | Marcelo Glezer <mg@tekii.com.ar> | 2015-01-14 12:03:40 -0300 |
---|---|---|
committer | Marcelo Glezer <mg@tekii.com.ar> | 2015-01-14 12:03:40 -0300 |
commit | a4bfa677e95b058c50d49b4b3ae986351ed0cbf8 (patch) | |
tree | f30559fea9c6d9924fb12dcfd4b97466d19719e1 /libmproxy/protocol/http.py | |
parent | 34d355a62b3103e322793e2af652ee0aa867ddaf (diff) | |
download | mitmproxy-a4bfa677e95b058c50d49b4b3ae986351ed0cbf8.tar.gz mitmproxy-a4bfa677e95b058c50d49b4b3ae986351ed0cbf8.tar.bz2 mitmproxy-a4bfa677e95b058c50d49b4b3ae986351ed0cbf8.zip |
now content and header are working and exception for binary files are handled correctly
Diffstat (limited to 'libmproxy/protocol/http.py')
-rw-r--r-- | libmproxy/protocol/http.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 4de1c0a6..f822fcc8 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): |