diff --git a/httpie/httpie.py b/httpie/httpie.py index cab1ffb5..04e95875 100755 --- a/httpie/httpie.py +++ b/httpie/httpie.py @@ -156,7 +156,7 @@ def main(): if args.prettify and sys.stdout.isatty(): if args.print_headers: - status_line = pretty.prettify_http(status_line) + status_line = pretty.prettify_http(status_line).strip() headers = pretty.prettify_http(headers) if args.print_body: body = pretty.prettify_body(body, @@ -166,8 +166,6 @@ def main(): print status_line print headers if args.print_body: - if args.print_headers: - print print body if __name__ == '__main__': diff --git a/httpie/pretty.py b/httpie/pretty.py index ee6eff4f..07907f7c 100644 --- a/httpie/pretty.py +++ b/httpie/pretty.py @@ -29,7 +29,7 @@ highlight_http = partial(highlight, lexer=HTTPLexer()) def prettify_http(headers): - return highlight_http(headers)[:-1] + return highlight_http(headers) def prettify_body(content, content_type):