From 21faddc4b967070c5910477f934c107c8d6e5be6 Mon Sep 17 00:00:00 2001 From: Batuhan Taskaya Date: Thu, 13 Jan 2022 15:04:44 +0300 Subject: [PATCH] Proper separation of meta/body --- httpie/output/streams.py | 7 ++----- httpie/output/writer.py | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/httpie/output/streams.py b/httpie/output/streams.py index 4371af39..ec275faa 100644 --- a/httpie/output/streams.py +++ b/httpie/output/streams.py @@ -76,14 +76,11 @@ class BaseStream(metaclass=ABCMeta): yield e.message if self.output_options.meta: - mixed = self.output_options.headers or self.output_options.body - - if mixed: + if self.output_options.body: yield b'\n\n' yield self.get_metadata() - if not mixed: - yield b'\n' + yield b'\n\n' class RawStream(BaseStream): diff --git a/httpie/output/writer.py b/httpie/output/writer.py index 0a911560..cbd06e92 100644 --- a/httpie/output/writer.py +++ b/httpie/output/writer.py @@ -115,7 +115,7 @@ def build_output_stream_for_message( output_options=output_options, **stream_kwargs, ) - if (env.stdout_isatty and output_options.body + if (env.stdout_isatty and output_options.body and not output_options.meta and not getattr(requests_message, 'is_body_upload_chunk', False)): # Ensure a blank line after the response body. # For terminal output only.