mirror of
https://github.com/adnanh/webhook.git
synced 2026-07-27 01:29:16 +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 {
|
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)
|
handleHook(matchedHook, req, w)
|
||||||
} else if matchedHook.CaptureCommandOutput {
|
} else if matchedHook.CaptureCommandOutput {
|
||||||
response, err := handleHook(matchedHook, req, nil)
|
response, err := handleHook(matchedHook, req, nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user