Set appropriate headers for streamed output

This commit is contained in:
Adnan Hajdarevic 2024-10-25 09:41:24 +02:00
parent 5420abff39
commit cd38e0bbed

View file

@ -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)