mirror of
https://github.com/httpie/cli.git
synced 2024-11-25 01:03:27 +01:00
Fixed header formatting.
This commit is contained in:
parent
5653b9c6a0
commit
4059dbc27a
@ -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__':
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user