From 411d44737e09f7e86a562bd3296b92d1a21e6c41 Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Fri, 21 Jun 2024 10:16:54 +0200 Subject: [PATCH] another test Bug Because the responses are to long --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index cd7dd04..ce91bd1 100644 --- a/main.go +++ b/main.go @@ -43,7 +43,7 @@ func createStreamResponse(fromLanguage, toLanguage, message string) string { return string(jsonResp) } -func streamResponse(w http.ResponseWriter, fromLanguage, toLanguage string, messages <-chan string) { +func streamResponse(w http.ResponseWriter, messages <-chan string) { w.Header().Set("Content-Type", "application/json; charset=utf-8") w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Connection", "keep-alive") @@ -55,7 +55,7 @@ func streamResponse(w http.ResponseWriter, fromLanguage, toLanguage string, mess } for msg := range messages { - formattedMessage := createStreamResponse(fromLanguage, toLanguage, msg) + formattedMessage := createStreamResponse(msg) fmt.Fprintf(w, " %s\n\n", formattedMessage) flusher.Flush() }