mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-14 17:44:42 +00:00
Set appropriate headers for streamed output
This commit is contained in:
parent
5420abff39
commit
cd38e0bbed
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue