From 0e2a554c8da6788cd331044a19c2ba9508baf37e Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Sat, 10 Jan 2015 21:08:52 -0800 Subject: [PATCH] cmds: fix error header output using Header().Set after WriteHeader() has no effect. cc @mappum --- commands/http/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/http/handler.go b/commands/http/handler.go index 329e8fa29..a409a67c3 100644 --- a/commands/http/handler.go +++ b/commands/http/handler.go @@ -95,8 +95,8 @@ func (i Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { out, err := res.Reader() if err != nil { - w.WriteHeader(http.StatusInternalServerError) w.Header().Set(contentTypeHeader, "text/plain") + w.WriteHeader(http.StatusInternalServerError) w.Write([]byte(err.Error())) return }