1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-28 08:38:44 +02:00

Fixed header formatting.

This commit is contained in:
Jakub Roztočil 2012-02-26 01:43:44 +01:00
parent 5653b9c6a0
commit 4059dbc27a
2 changed files with 2 additions and 4 deletions

View File

@ -156,7 +156,7 @@ def main():
if args.prettify and sys.stdout.isatty(): if args.prettify and sys.stdout.isatty():
if args.print_headers: if args.print_headers:
status_line = pretty.prettify_http(status_line) status_line = pretty.prettify_http(status_line).strip()
headers = pretty.prettify_http(headers) headers = pretty.prettify_http(headers)
if args.print_body: if args.print_body:
body = pretty.prettify_body(body, body = pretty.prettify_body(body,
@ -166,8 +166,6 @@ def main():
print status_line print status_line
print headers print headers
if args.print_body: if args.print_body:
if args.print_headers:
print
print body print body
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -29,7 +29,7 @@ highlight_http = partial(highlight, lexer=HTTPLexer())
def prettify_http(headers): def prettify_http(headers):
return highlight_http(headers)[:-1] return highlight_http(headers)
def prettify_body(content, content_type): def prettify_body(content, content_type):