@cryptotaxi247 / kubo / commits / 0e2a554c8

cmds: fix error header output

using Header().Set after WriteHeader() has no effect. cc @mappum

Juan Batiz-Benet committed Jan 10, 2015 at 21:08 UTC 0e2a554c8da6788cd331044a19c2ba9508baf37e
1 file changed +1 -1
commands/http/handler.go
+1 -1
@@ -95,8 +95,8 @@ func (i Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
95
96 out, err := res.Reader()
97 if err != nil {
98 - w.WriteHeader(http.StatusInternalServerError)
98 w.Header().Set(contentTypeHeader, "text/plain")
99 + w.WriteHeader(http.StatusInternalServerError)
100 w.Write([]byte(err.Error()))
101 return
102 }