fixes content-type for post and put on actions
All checks were successful
gitea-deepak/gogmagog/pipeline/head This commit looks good

This commit is contained in:
Deepak Mallubhotla 2021-01-10 11:58:16 -06:00
parent 7e7558dd5e
commit c0175fc9bc
Signed by: deepak
GPG Key ID: 6CB12CEDEC85EA3C

View File

@ -117,8 +117,8 @@ func postActionFunc(m *models.Model) http.HandlerFunc {
CreatedAction: action,
ID: int64(id),
}
w.WriteHeader(http.StatusCreated)
w.Header().Add("Content-Type", "application/json")
w.WriteHeader(http.StatusCreated)
if err := json.NewEncoder(w).Encode(response); err != nil {
serverError(w, err)
}
@ -176,8 +176,8 @@ func putActionFunc(m *models.Model) http.HandlerFunc {
UpdatedAction: action,
ID: int64(id),
}
w.WriteHeader(http.StatusOK)
w.Header().Add("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
if err := json.NewEncoder(w).Encode(response); err != nil {
serverError(w, err)
}