periodically flush writer

pull/6/head
ilackarms 2018-01-13 13:14:31 -05:00
parent 188e6ebcdb
commit 410b4016fd
1 changed files with 1 additions and 0 deletions

View File

@ -136,6 +136,7 @@ func (c *compressionResponseWriter) Write(p []byte) (int, error) {
return -1, errors.New("compressing error: tried to write data using closed compressor")
}
c.Header().Set(headerContentEncoding, c.encoding)
defer c.compressor.Flush()
return c.compressor.Write(p)
}