Make the api write header first for bad request.

pull/17/head
Paul Dix 2013-10-18 16:50:05 -04:00
parent 7f90b11e56
commit f530dba9ef
1 changed files with 1 additions and 1 deletions

View File

@ -150,8 +150,8 @@ func (self *HttpServer) writePoints(w http.ResponseWriter, r *http.Request) {
serializedSeries := []*SerializedSeries{}
err = json.Unmarshal(series, &serializedSeries)
if err != nil {
w.Write([]byte(err.Error()))
w.WriteHeader(http.StatusBadRequest)
w.Write([]byte(err.Error()))
return
}