New error handling added to getRequestBody function in data package

This commit is contained in:
Héctor Hurtado
2019-11-18 15:01:02 +01:00
parent e4b3a4f718
commit 4c7eae8ebb
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ func WriteErrorResponse(statusCode int, reasonMsg string, res http.ResponseWrite
respBody := ServerErrMessage{}
respBody.Reason = reasonMsg
bb, _ := json.Marshal(respBody)
res.Header().Add("Content-Type", "application/json; charset=utf-8")
res.Header().Set("Content-Type", "application/json; charset=utf-8")
res.WriteHeader(statusCode)
_, _ = res.Write(bb)
}