From 3fdabb2229a451c5c0aa9ef7b625d52dcff226b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Thu, 4 Nov 2021 00:20:30 +0100 Subject: [PATCH] Fixing returned value of getSnapshotDownloadLinkEventHandler --- handlers_nats.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/handlers_nats.go b/handlers_nats.go index 667113f..8d6ede4 100644 --- a/handlers_nats.go +++ b/handlers_nats.go @@ -1013,7 +1013,16 @@ func getSnapshotDownloadLinkEventHandler(m *nats.Msg, message *RequestMessage) e return errorReplyFormater(m, "backend error", err) } - err = m.Respond([]byte(link)) + reply := ReplyMessage{ + Payload: link, + } + + data, err := json.Marshal(reply) + if err != nil { + return errorReplyFormater(m, "reply formatter error", err) + } + + err = m.Respond(data) if err != nil { log.Println("ERROR: get snapshot:", err.Error()) }