mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
fix(api): add json content-type to all json API responses (#1809)
This commit is contained in:
parent
4f0e752d00
commit
7690ef3c33
2 changed files with 2 additions and 0 deletions
|
@ -17,6 +17,7 @@ func WriteErrorResponse(w http.ResponseWriter, err error, code int, logger *log.
|
|||
logger.Printf("http error: %s (code=%d)", err, code)
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(code)
|
||||
json.NewEncoder(w).Encode(&errorResponse{Err: err.Error()})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue