From f89a5235d36db8c82ec608ba1f39809d2a355384 Mon Sep 17 00:00:00 2001 From: Marcelo Glezer Date: Wed, 14 Jan 2015 10:52:52 -0300 Subject: wip - content copy is working, header representation is not --- libmproxy/protocol/http.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libmproxy/protocol/http.py') diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index bebb4f7b..04e3fe40 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -953,6 +953,21 @@ class HTTPFlow(Flow): c += self.response.replace(pattern, repl, *args, **kwargs) return c + def response_content(self): + s = "[No Content]" + with decoded(self.response): + s = self.response.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 + class HttpAuthenticationError(Exception): def __init__(self, auth_headers=None): -- cgit v1.2.3