aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-04-15 10:29:57 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-04-15 10:29:57 +1200
commit5ff430312440d9ed95a003a2d3afc018669dfb6f (patch)
tree19719728c20fcd06ddd74ea56037d942d21bf8ed /libmproxy
parentf33b483110db7a62b45e77b693176e2fba0dede9 (diff)
downloadmitmproxy-5ff430312440d9ed95a003a2d3afc018669dfb6f.tar.gz
mitmproxy-5ff430312440d9ed95a003a2d3afc018669dfb6f.tar.bz2
mitmproxy-5ff430312440d9ed95a003a2d3afc018669dfb6f.zip
Adjust for ODict interface change
Diffstat (limited to 'libmproxy')
-rw-r--r--libmproxy/dump.py2
-rw-r--r--libmproxy/flow.py2
-rw-r--r--libmproxy/protocol/http.py4
3 files changed, 4 insertions, 4 deletions
diff --git a/libmproxy/dump.py b/libmproxy/dump.py
index c464644c..59e46dbb 100644
--- a/libmproxy/dump.py
+++ b/libmproxy/dump.py
@@ -171,7 +171,7 @@ class DumpMaster(flow.FlowMaster):
def _print_message(self, message):
if self.o.flow_detail >= 2:
- print(self.indent(4, message.headers), file=self.outfile)
+ print(self.indent(4, message.headers.format()), file=self.outfile)
if self.o.flow_detail >= 3:
if message.content == http.CONTENT_MISSING:
print(self.indent(4, "(content missing)"), file=self.outfile)
diff --git a/libmproxy/flow.py b/libmproxy/flow.py
index a010bb39..553bfd84 100644
--- a/libmproxy/flow.py
+++ b/libmproxy/flow.py
@@ -268,7 +268,7 @@ class ServerPlaybackState:
# to prevent a mismatch between unicode/non-unicode.
v = [str(x) for x in v]
hdrs.append((i, v))
- key.append(repr(hdrs))
+ key.append(hdrs)
return hashlib.sha256(repr(key)).digest()
def next_flow(self, request):
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py
index eb7749ea..da6b8aa6 100644
--- a/libmproxy/protocol/http.py
+++ b/libmproxy/protocol/http.py
@@ -469,7 +469,7 @@ class HTTPRequest(HTTPMessage):
if self.content or self.content == "":
headers["Content-Length"] = [str(len(self.content))]
- return str(headers)
+ return headers.format()
def _assemble_head(self, form=None):
return "%s\r\n%s\r\n" % (
@@ -823,7 +823,7 @@ class HTTPResponse(HTTPMessage):
if self.content or self.content == "":
headers["Content-Length"] = [str(len(self.content))]
- return str(headers)
+ return headers.format()
def _assemble_head(self, preserve_transfer_encoding=False):
return '%s\r\n%s\r\n' % (