mirror of
https://github.com/adnanh/webhook.git
synced 2026-07-26 17:19:17 +08:00
Set appropriate headers for streamed output
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user