Proper separation of meta/body

This commit is contained in:
Batuhan Taskaya 2022-01-13 15:04:44 +03:00
parent c126bc11c7
commit 21faddc4b9
2 changed files with 3 additions and 6 deletions

View File

@ -76,14 +76,11 @@ class BaseStream(metaclass=ABCMeta):
yield e.message yield e.message
if self.output_options.meta: if self.output_options.meta:
mixed = self.output_options.headers or self.output_options.body if self.output_options.body:
if mixed:
yield b'\n\n' yield b'\n\n'
yield self.get_metadata() yield self.get_metadata()
if not mixed: yield b'\n\n'
yield b'\n'
class RawStream(BaseStream): class RawStream(BaseStream):

View File

@ -115,7 +115,7 @@ def build_output_stream_for_message(
output_options=output_options, output_options=output_options,
**stream_kwargs, **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)): and not getattr(requests_message, 'is_body_upload_chunk', False)):
# Ensure a blank line after the response body. # Ensure a blank line after the response body.
# For terminal output only. # For terminal output only.