diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index 6196dc0e9..e7a10d601 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -192,6 +192,15 @@ class FileLike: def flush(self): pass + def read(self, length): + result = '' + while len(result) < length: + data = self.o.read(length) + if not data: + break + result += data + return result + def readline(self): result = '' while True: