BugFix related to wrong function names

This commit is contained in:
Falko Victor Habel 2024-06-21 09:41:57 +02:00
parent 40849e0fbb
commit 68032cb37d
1 changed files with 2 additions and 6 deletions

View File

@ -29,11 +29,7 @@ type StreamResponse struct {
const linux = "python3" const linux = "python3"
func streamResponse(w http.ResponseWriter, fromLanguage, toLanguage string, messages <-chan string) { func createStreamResponse(fromLanguage, toLanguage, message string) string {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Connection", "keep-alive")
response := StreamResponse{ response := StreamResponse{
From: fromLanguage, From: fromLanguage,
To: toLanguage, To: toLanguage,
@ -48,7 +44,7 @@ func streamResponse(w http.ResponseWriter, fromLanguage, toLanguage string, mess
} }
func streamResponse(w http.ResponseWriter, fromLanguage, toLanguage string, messages <-chan string) { func streamResponse(w http.ResponseWriter, fromLanguage, toLanguage string, messages <-chan string) {
w.Header().Set("Content-Type", "text/event-stream") w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Connection", "keep-alive") w.Header().Set("Connection", "keep-alive")