From b92a3a6d955bee01750901572cceae4ea033dc2b Mon Sep 17 00:00:00 2001 From: Jakub Roztocil Date: Mon, 13 Aug 2012 23:32:33 +0200 Subject: [PATCH] Iter body lines to avoid binary false positives. #84 --- httpie/output.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httpie/output.py b/httpie/output.py index 1b6911ac..ccb995ef 100644 --- a/httpie/output.py +++ b/httpie/output.py @@ -262,10 +262,10 @@ class BufferedPrettyStream(PrettyStream): # Read the whole body before prettifying it, # but bail out immediately if the body is binary. body = bytearray() - for chunk in self.msg.iter_body(self.CHUNK_SIZE): + for chunk, lf in self.msg.iter_lines(self.CHUNK_SIZE): if b'\0' in chunk: raise BinarySuppressedError() - body.extend(chunk) + body.extend(chunk + lf) yield self._process_body(body)