mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Merge pull request #72575 from liggitt/flush-streamer-headers
Flush headers before streaming logs
This commit is contained in:
commit
080d2a43eb
@ -101,6 +101,10 @@ func StreamObject(statusCode int, gv schema.GroupVersion, s runtime.NegotiatedSe
|
|||||||
}
|
}
|
||||||
w.Header().Set("Content-Type", contentType)
|
w.Header().Set("Content-Type", contentType)
|
||||||
w.WriteHeader(statusCode)
|
w.WriteHeader(statusCode)
|
||||||
|
// Flush headers, if possible
|
||||||
|
if flusher, ok := w.(http.Flusher); ok {
|
||||||
|
flusher.Flush()
|
||||||
|
}
|
||||||
writer := w.(io.Writer)
|
writer := w.(io.Writer)
|
||||||
if flush {
|
if flush {
|
||||||
writer = flushwriter.Wrap(w)
|
writer = flushwriter.Wrap(w)
|
||||||
|
Loading…
Reference in New Issue
Block a user