aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-07-01 17:49:18 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-07-01 17:49:18 -0700
commit2c09e0416bcf94d9ebef7c11bb1883388e8e2c5d (patch)
tree93f59efcad701d58d2b545fde3103dae6dd13b5a
parentfa7246279817b7c01448fd4059c8d2be34e84f8b (diff)
downloadmitmproxy-2c09e0416bcf94d9ebef7c11bb1883388e8e2c5d.tar.gz
mitmproxy-2c09e0416bcf94d9ebef7c11bb1883388e8e2c5d.tar.bz2
mitmproxy-2c09e0416bcf94d9ebef7c11bb1883388e8e2c5d.zip
minor fixes
-rw-r--r--netlib/websockets/frame.py2
-rw-r--r--pathod/language/http2.py2
-rw-r--r--pathod/log.py2
-rw-r--r--test/netlib/test_strutils.py10
4 files changed, 8 insertions, 8 deletions
diff --git a/netlib/websockets/frame.py b/netlib/websockets/frame.py
index 42196ffb..671e1605 100644
--- a/netlib/websockets/frame.py
+++ b/netlib/websockets/frame.py
@@ -255,7 +255,7 @@ class Frame(object):
def __repr__(self):
ret = repr(self.header)
if self.payload:
- ret = ret + "\nPayload:\n" + strutils.clean_bin(self.payload).decode("ascii")
+ ret = ret + "\nPayload:\n" + strutils.clean_bin(self.payload)
return ret
def human_readable(self):
diff --git a/pathod/language/http2.py b/pathod/language/http2.py
index 2693446e..c0313baa 100644
--- a/pathod/language/http2.py
+++ b/pathod/language/http2.py
@@ -273,7 +273,7 @@ class Request(_HTTP2Message):
req = http.Request(
b'',
self.method.string(),
- b'',
+ b'http',
b'',
b'',
path,
diff --git a/pathod/log.py b/pathod/log.py
index 23e9a2ce..1d3ec356 100644
--- a/pathod/log.py
+++ b/pathod/log.py
@@ -62,7 +62,7 @@ class LogCtx(object):
for line in strutils.hexdump(data):
self("\t%s %s %s" % line)
else:
- for i in strutils.clean_bin(data).split(b"\n"):
+ for i in strutils.clean_bin(data).split("\n"):
self("\t%s" % i)
def __call__(self, line):
diff --git a/test/netlib/test_strutils.py b/test/netlib/test_strutils.py
index a50fc40a..16e5d0b3 100644
--- a/test/netlib/test_strutils.py
+++ b/test/netlib/test_strutils.py
@@ -16,11 +16,11 @@ def test_native():
def test_clean_bin():
- assert strutils.clean_bin(b"one") == b"one"
- assert strutils.clean_bin(b"\00ne") == b".ne"
- assert strutils.clean_bin(b"\nne") == b"\nne"
- assert strutils.clean_bin(b"\nne", False) == b".ne"
- assert strutils.clean_bin(u"\u2605".encode("utf8")) == b"..."
+ assert strutils.clean_bin(b"one") == u"one"
+ assert strutils.clean_bin(b"\00ne") == u".ne"
+ assert strutils.clean_bin(b"\nne") == u"\nne"
+ assert strutils.clean_bin(b"\nne", False) == u".ne"
+ assert strutils.clean_bin(u"\u2605".encode("utf8")) == u"..."
assert strutils.clean_bin(u"one") == u"one"
assert strutils.clean_bin(u"\00ne") == u".ne"