From 06a87a6d07531056b03357008bbc9cccc5f8b1d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Cluseau?= Date: Sat, 21 Feb 2026 14:34:53 +0100 Subject: [PATCH] fix ws config as yaml --- cmd/dkl-local-server/initrd.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/dkl-local-server/initrd.go b/cmd/dkl-local-server/initrd.go index 38aeb81..94b7b0f 100644 --- a/cmd/dkl-local-server/initrd.go +++ b/cmd/dkl-local-server/initrd.go @@ -4,14 +4,12 @@ import ( "encoding/json" "log" "net/http" - - yaml "gopkg.in/yaml.v2" ) -func renderConfig(w http.ResponseWriter, r *http.Request, ctx *renderContext, asJson bool) (err error) { +func renderConfig(w http.ResponseWriter, _ *http.Request, ctx *renderContext, asJson bool) (err error) { log.Printf("sending config for %q", ctx.Host.Name) - _, cfg, err := ctx.Config() + cfgBytes, cfg, err := ctx.Config() if err != nil { return err } @@ -19,7 +17,7 @@ func renderConfig(w http.ResponseWriter, r *http.Request, ctx *renderContext, as if asJson { err = json.NewEncoder(w).Encode(cfg) } else { - err = yaml.NewEncoder(w).Encode(cfg) + _, err = w.Write(cfgBytes) } return nil