diff --git a/httputils.go b/httputils.go index 4cd7e85b..645c3a20 100644 --- a/httputils.go +++ b/httputils.go @@ -14,6 +14,7 @@ type APIResponse struct { // respond response returns a JSON response to the client. func (s *server) respond(w http.ResponseWriter, r *http.Request, resp interface{}) { + w.Header().Add("Content-Type", "application/json") w.WriteHeader(http.StatusOK) encoder := json.NewEncoder(w) err := encoder.Encode(resp) @@ -27,6 +28,7 @@ func (s *server) respond(w http.ResponseWriter, r *http.Request, resp interface{ func (s *server) error(w http.ResponseWriter, r *http.Request, err error) { log.Printf("returning error response: %v", err) + w.Header().Add("Content-Type", "application/json") w.WriteHeader(http.StatusInternalServerError) encoder := json.NewEncoder(w) werr := encoder.Encode(APIResponse{ diff --git a/test.json b/test.json new file mode 100644 index 00000000..b24017d8 --- /dev/null +++ b/test.json @@ -0,0 +1,23 @@ +{ + "name": "test4", + "namespace": "zachary-seguin", + "image": "k8scc01covidacr.azurecr.io/minimal-notebook-cpu:d58600076b0c188364d8651d3986ee0d37ecb4ad", + "customImage": "", + "customImageCheck": false, + "cpu": "0.5", + "memory": "1.0Gi", + "gpus": { + "num": "none" + }, + "noWorkspace": false, + "workspace": { + "type": "Existing", + "name": "workspace-test4", + "templatedName": "workspace-{notebook-name}", + "class": "{none}", + "extraFields": {} + }, + "datavols": [], + "shm": true, + "configurations": ["minio-profile"] +}