From 974f00be4e93c8548816a47b09d5ea6fc973295b Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Fri, 14 Apr 2017 18:27:22 +0200 Subject: [PATCH] [fix] add formatter to request right after initialization --- wuzz.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wuzz.go b/wuzz.go index d96d0fa..8fc39a6 100644 --- a/wuzz.go +++ b/wuzz.go @@ -863,6 +863,8 @@ func (a *App) SubmitRequest(g *gocui.Gui, _ *gocui.View) error { r.RawResponseBody = bodyBytes } + r.Formatter = formatter.New(a.config, r.ContentType) + // add to history a.history = append(a.history, r) a.historyIndex = len(a.history) - 1 @@ -918,10 +920,6 @@ func (a *App) PrintBody(g *gocui.Gui) { vrb.Clear() var responseFormatter formatter.ResponseFormatter - - if req.Formatter == nil { - req.Formatter = formatter.New(a.config, req.ContentType) - } responseFormatter = req.Formatter vrb.Title = VIEW_PROPERTIES[vrb.Name()].title + " " + responseFormatter.Title()