From 494d271cb352d0fecaeef5a1483bf799a66d8046 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Thu, 4 Aug 2022 16:27:18 -0700 Subject: [PATCH 1/2] Set headers to json after successful encode --- exp/lighthorizon/actions/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exp/lighthorizon/actions/main.go b/exp/lighthorizon/actions/main.go index c091dad1ab..d1e2ae331f 100644 --- a/exp/lighthorizon/actions/main.go +++ b/exp/lighthorizon/actions/main.go @@ -61,6 +61,8 @@ func sendPageResponse(w http.ResponseWriter, page hal.Page) { if err != nil { log.Error(err) sendErrorResponse(w, http.StatusInternalServerError, "") + } else { + w.Header().Set("Content-Type", "application/openapi+yaml") } } From 465861f7d085e66a2075519b588d670118ae7430 Mon Sep 17 00:00:00 2001 From: George Kudrayvtsev Date: Fri, 5 Aug 2022 10:35:26 -0700 Subject: [PATCH 2/2] :facepalm: thanks @bartekn --- exp/lighthorizon/actions/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exp/lighthorizon/actions/main.go b/exp/lighthorizon/actions/main.go index d1e2ae331f..f7d784e503 100644 --- a/exp/lighthorizon/actions/main.go +++ b/exp/lighthorizon/actions/main.go @@ -62,7 +62,7 @@ func sendPageResponse(w http.ResponseWriter, page hal.Page) { log.Error(err) sendErrorResponse(w, http.StatusInternalServerError, "") } else { - w.Header().Set("Content-Type", "application/openapi+yaml") + w.Header().Set("Content-Type", "application/hal+json; charset=utf-8") } }