fix json response

This commit is contained in:
Livio Amstutz 2021-08-20 07:47:45 +02:00
parent d2d3395c25
commit 38a1f315de
3 changed files with 9 additions and 13 deletions

View file

@ -22,8 +22,7 @@ func keysHandler(k KeyProvider) func(http.ResponseWriter, *http.Request) {
func Keys(w http.ResponseWriter, r *http.Request, k KeyProvider) {
keySet, err := k.GetKeySet(r.Context())
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
utils.MarshalJSON(w, err)
utils.MarshalJSONWithStatus(w, err, http.StatusInternalServerError)
return
}
utils.MarshalJSON(w, keySet)