Flush headers before streaming logs

This commit is contained in:
Jordan Liggitt 2019-01-04 10:16:40 -05:00
parent dba49e60aa
commit 93625f5026

View File

@ -101,6 +101,10 @@ func StreamObject(statusCode int, gv schema.GroupVersion, s runtime.NegotiatedSe
}
w.Header().Set("Content-Type", contentType)
w.WriteHeader(statusCode)
// Flush headers, if possible
if flusher, ok := w.(http.Flusher); ok {
flusher.Flush()
}
writer := w.(io.Writer)
if flush {
writer = flushwriter.Wrap(w)