mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-11 16:14:52 +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 {
|
||||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue