log api: set http Content Type

set the Content-Type header to `text/plain;charset=UTF-8`
This commit is contained in:
Simone Gotti 2024-05-13 13:35:52 +02:00
parent fcce8c7628
commit f1b5688f49
2 changed files with 2 additions and 0 deletions

View File

@ -620,6 +620,7 @@ func (h *LogsHandler) do(w http.ResponseWriter, r *http.Request) error {
// header also if there're currently no lines to send
w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Connection", "keep-alive")
w.Header().Set("Content-Type", "text/plain;charset=UTF-8")
w.WriteHeader(http.StatusOK)
var flusher http.Flusher
if fl, ok := w.(http.Flusher); ok {

View File

@ -255,6 +255,7 @@ func (h *LogsHandler) readTaskLogs(ctx context.Context, runID, taskID string, se
// header also if there're currently no lines to send
w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Connection", "keep-alive")
w.Header().Set("Content-Type", "text/plain;charset=UTF-8")
w.WriteHeader(http.StatusOK)
var flusher http.Flusher
if fl, ok := w.(http.Flusher); ok {