From 95545c72b6f90d145a5267f85251fcc69fff7b4c Mon Sep 17 00:00:00 2001 From: Omer Tuchfeld Date: Thu, 9 Nov 2023 10:32:43 +0100 Subject: [PATCH] `/apis` endpoint should have json content type Since it's already serialized it doesn't go through `serializeAndWrite` and so we don't set `Content-Type` Having the wrong `Content-Type` seems to cause issues with newer versions of `oc`, as it worked fine before and I think my `oc` version is the only thing that changed --- pkg/handler/handler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 22f39f8..255856f 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -221,6 +221,7 @@ func New(l *zap.Logger, baseDir string, port string) (*mux.Router, error) { } }).Methods(http.MethodGet) router.HandleFunc("/apis", func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/json") w.Write(serializedGroupList) }).Methods(http.MethodGet) for groupVersion := range groupSerializedResourceListMap {