1
0
mirror of https://github.com/httpie/cli.git synced 2026-06-11 21:51:06 +02:00

Iter body lines to avoid binary false positives.

#84
This commit is contained in:
Jakub Roztocil
2012-08-13 23:32:33 +02:00
parent 9098e5b6e8
commit b92a3a6d95
+2 -2
View File
@@ -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)