aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol/http.py
diff options
context:
space:
mode:
authorMarcelo Glezer <marcelo.glezer@gmail.com>2015-01-14 10:52:52 -0300
committerMarcelo Glezer <mg@tekii.com.ar>2015-02-05 11:31:24 -0300
commitf89a5235d36db8c82ec608ba1f39809d2a355384 (patch)
treea769d38c3d57423d66393736b36bc0ccd91fe077 /libmproxy/protocol/http.py
parent4a481814f6ffca51feaadadec8239f0e6249ba26 (diff)
downloadmitmproxy-f89a5235d36db8c82ec608ba1f39809d2a355384.tar.gz
mitmproxy-f89a5235d36db8c82ec608ba1f39809d2a355384.tar.bz2
mitmproxy-f89a5235d36db8c82ec608ba1f39809d2a355384.zip
wip - content copy is working, header representation is not
Diffstat (limited to 'libmproxy/protocol/http.py')
-rw-r--r--libmproxy/protocol/http.py15
1 files changed, 15 insertions, 0 deletions
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):