From db9a07a42e31f887887d43af83af5effa106e714 Mon Sep 17 00:00:00 2001 From: Athul Cyriac Ajay Date: Thu, 13 Feb 2020 07:06:09 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AC=F0=9F=A4=9D=20Extended=20to=20resp?= =?UTF-8?q?onse=20of=20Plain=20and=20HTML/XML?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Ben Morrison --- methods/fns.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/methods/fns.go b/methods/fns.go index 3c5c623..5cdde46 100644 --- a/methods/fns.go +++ b/methods/fns.go @@ -39,7 +39,12 @@ func formatresp(resp *http.Response) string { c.Print(key, " : ") magenta.Print(value, "\n") } - s := c.Sprint(gohtml.Format(str)) + var s string + if strings.Contains(heads, "plain") { + s = str + } else { + s = c.Sprint(gohtml.Format(str)) + } retbody = yellow.Sprintf("\nStatus:\t\t%s\n\nStatusCode:\t%d\n", resp.Status, resp.StatusCode) + fmt.Sprintf("\n%s\n", s) }