The ResponseWriters defined in rest.handler add Flush interface. (#318)

This commit is contained in:
jichangyun
2020-12-28 21:30:24 +08:00
committed by GitHub
parent 71a2b20301
commit 0bd2a0656c
8 changed files with 88 additions and 0 deletions

View File

@@ -95,6 +95,12 @@ func (w *cryptionResponseWriter) WriteHeader(statusCode int) {
w.ResponseWriter.WriteHeader(statusCode)
}
func (w *cryptionResponseWriter) Flush() {
if flusher, ok := w.ResponseWriter.(http.Flusher); ok {
flusher.Flush()
}
}
func (w *cryptionResponseWriter) flush(key []byte) {
if w.buf.Len() == 0 {
return