From 6be394c2e02d297564983778f21b18c336855297 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Mon, 13 May 2019 09:20:55 +1200 Subject: [PATCH] refactor(api): minor refactor to stream.go --- api/http/handler/websocket/stream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/http/handler/websocket/stream.go b/api/http/handler/websocket/stream.go index 850d44a4c..a598b7cb7 100644 --- a/api/http/handler/websocket/stream.go +++ b/api/http/handler/websocket/stream.go @@ -27,12 +27,12 @@ func streamFromTCPConnToWebsocketConn(websocketConn *websocket.Conn, br *bufio.R for { out := make([]byte, 2048) _, err := br.Read(out) - processedOutput := validString(string(out[:])) if err != nil { errorChan <- err break } + processedOutput := validString(string(out[:])) err = websocketConn.WriteMessage(websocket.TextMessage, []byte(processedOutput)) if err != nil { errorChan <- err