add content type before writing header (#1887)

This commit is contained in:
Bethuel Mmbaga
2024-04-25 21:20:24 +02:00
committed by GitHub
parent 7b254cb966
commit 71c6437bab
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -181,8 +181,8 @@ func (h *SetupKeysHandler) GetAllSetupKeys(w http.ResponseWriter, r *http.Reques
}
func writeSuccess(w http.ResponseWriter, key *server.SetupKey) {
w.WriteHeader(200)
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(200)
err := json.NewEncoder(w).Encode(toResponseBody(key))
if err != nil {
util.WriteError(err, w)