diff --git a/qa/api/handler.go b/qa/api/handler.go index f823a853..424c0288 100644 --- a/qa/api/handler.go +++ b/qa/api/handler.go @@ -37,16 +37,16 @@ func apiHandler(f DispatchFunction) func(http.ResponseWriter, *http.Request, htt if ficteam == "" { log.Printf("%s 401 \"%s %s\" [%s]\n", r.RemoteAddr, r.Method, r.URL.Path, r.UserAgent()) w.Header().Set("Content-Type", "application/json") - http.Error(w, fmt.Sprintf("{errmsg:\"Need to authenticate.\"}"), http.StatusUnauthorized) + http.Error(w, fmt.Sprintf("{\"errmsg\":\"Need to authenticate.\"}"), http.StatusUnauthorized) return } else if teamid, err = strconv.ParseInt(ficteam, 10, 64); err != nil { if lnk, err := os.Readlink(path.Join(TeamsDir, ficteam)); err != nil { log.Printf("[ERR] Unable to readlink %q: %s\n", path.Join(TeamsDir, ficteam), err) - http.Error(w, fmt.Sprintf("{errmsg:\"Unable to validate authentication.\"}"), http.StatusInternalServerError) + http.Error(w, fmt.Sprintf("{\"errmsg\":\"Unable to validate authentication.\"}"), http.StatusInternalServerError) return } else if teamid, err = strconv.ParseInt(lnk, 10, 64); err != nil { log.Printf("[ERR] Error during ParseInt team %q: %s\n", lnk, err) - http.Error(w, fmt.Sprintf("{errmsg:\"Unable to validate authentication.\"}"), http.StatusInternalServerError) + http.Error(w, fmt.Sprintf("{\"errmsg\":\"Unable to validate authentication.\"}"), http.StatusInternalServerError) return } } @@ -55,7 +55,7 @@ func apiHandler(f DispatchFunction) func(http.ResponseWriter, *http.Request, htt // Read the body if r.ContentLength < 0 || r.ContentLength > 6553600 { - http.Error(w, fmt.Sprintf("{errmsg:\"Request too large or request size unknown\"}"), http.StatusRequestEntityTooLarge) + http.Error(w, fmt.Sprintf("{\"errmsg\":\"Request too large or request size unknown\"}"), http.StatusRequestEntityTooLarge) return } var body []byte