From cd38e0bbedb29495586ef6cfadb70ebc7c552229 Mon Sep 17 00:00:00 2001 From: Adnan Hajdarevic Date: Fri, 25 Oct 2024 09:41:24 +0200 Subject: [PATCH] Set appropriate headers for streamed output --- webhook.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webhook.go b/webhook.go index dccc04f9..88b07ab6 100644 --- a/webhook.go +++ b/webhook.go @@ -523,6 +523,9 @@ func hookHandler(w http.ResponseWriter, r *http.Request) { } if matchedHook.StreamCommandOutput { + w.Header().Set("Content-Type", "text/event-stream") + w.Header().Set("Cache-Control", "no-cache") + w.Header().Set("Connection", "keep-alive") handleHook(matchedHook, req, w) } else if matchedHook.CaptureCommandOutput { response, err := handleHook(matchedHook, req, nil)