Flush headers before streaming logs
Kubernetes-commit: 93625f502676f7a89474cdd3d588354a8ffabb78
This commit is contained in:
parent
84dc8f2ac2
commit
5e146b0a14
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue