From 7a3a282c711870f75ddbded33b016ae9c5d1c8c2 Mon Sep 17 00:00:00 2001 From: r0n1n7an Date: Fri, 22 Nov 2024 15:17:03 +0800 Subject: [PATCH] correct http status code for racs/getfaillist api --- APIServer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/APIServer.go b/APIServer.go index 6b2a578..633c8df 100644 --- a/APIServer.go +++ b/APIServer.go @@ -592,8 +592,11 @@ func handleRacsGetFailList(w http.ResponseWriter, r *http.Request) { rst["Result"] = "NG" rst["ErrMsg"] = "racs.HandleGetFailList: " + err.Error() logger.Printf("[ERR] %s; %s; %s\r\n", addr, uri, rst["ErrMsg"]) + w.WriteHeader(http.StatusInternalServerError) + fmt.Fprintf(w, "%v", rpl.Replace(fmt.Sprintf("%#v", rst))) + return } - w.WriteHeader(http.StatusInternalServerError) + w.WriteHeader(http.StatusOK) fmt.Fprintf(w, "%v", rpl.Replace(string(jsonData))) return }