diff --git a/mux/jose.go b/mux/jose.go index 456bb52..8deb183 100644 --- a/mux/jose.go +++ b/mux/jose.go @@ -75,13 +75,14 @@ var emptyResponse = []byte("{}") func jsonRender(w http.ResponseWriter, response *proxy.Response) error { w.Header().Set("Content-Type", "application/json") - w.WriteHeader(response.Metadata.StatusCode) if response == nil { _, err := w.Write(emptyResponse) return err } + w.WriteHeader(response.Metadata.StatusCode) + js, err := json.Marshal(response.Data) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError)