fix(server/v2): set correct content-type for etcdError response

"net/http".Error reset the content type, so we get rid of it and
write our own one.
This commit is contained in:
Yicheng Qin
2014-05-29 14:18:50 -07:00
parent b3c5ed60bd
commit db4c5e0eaa
2 changed files with 5 additions and 1 deletions

View File

@@ -143,5 +143,6 @@ func (e Error) Write(w http.ResponseWriter) {
status = http.StatusInternalServerError
}
}
http.Error(w, e.toJsonString(), status)
w.WriteHeader(status)
fmt.Fprintln(w, e.toJsonString())
}