From c7c29d126091e9c2ac6a8753e1c155fea41f04e3 Mon Sep 17 00:00:00 2001 From: siyul-park Date: Fri, 1 Dec 2023 23:08:44 -0500 Subject: [PATCH] style: more readable --- pkg/plugin/networkx/http.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/plugin/networkx/http.go b/pkg/plugin/networkx/http.go index 2f760741..1d36163c 100644 --- a/pkg/plugin/networkx/http.go +++ b/pkg/plugin/networkx/http.go @@ -379,8 +379,9 @@ func (n *HTTPNode) ServeHTTP(w http.ResponseWriter, r *http.Request) { n.mu.RLock() defer n.mu.RUnlock() - proc := process.New() var procErr error + proc := process.New() + defer func() { proc.Stack().Wait() proc.Exit(procErr) @@ -404,12 +405,14 @@ func (n *HTTPNode) ServeHTTP(w http.ResponseWriter, r *http.Request) { _ = n.response(r, w, n.errorPayload(proc, UnsupportedMediaType)) return } + outPayload, err := primitive.MarshalText(req) if err != nil { procErr = err _ = n.response(r, w, n.errorPayload(proc, BadRequest)) return } + outPck := packet.New(outPayload) if ioStream.Links() > 0 {