mirror of
https://github.com/httpie/cli.git
synced 2024-11-24 16:53:35 +01:00
Proper separation of meta/body
This commit is contained in:
parent
c126bc11c7
commit
21faddc4b9
@ -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):
|
||||||
|
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user