mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-30 14:58:38 +00:00
minor fixes
This commit is contained in:
parent
fa72462798
commit
2c09e0416b
@ -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):
|
||||
|
@ -273,7 +273,7 @@ class Request(_HTTP2Message):
|
||||
req = http.Request(
|
||||
b'',
|
||||
self.method.string(),
|
||||
b'',
|
||||
b'http',
|
||||
b'',
|
||||
b'',
|
||||
path,
|
||||
|
@ -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):
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user