mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2026-01-08 16:21:50 +00:00
Write JSON content type for API responses
This commit is contained in:
@@ -345,6 +345,7 @@ func (server *APIServer) notFound(w http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
|
||||
func (server *APIServer) write(statusCode int, object interface{}, w http.ResponseWriter) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(statusCode)
|
||||
output, err := api.Encode(object)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user