Merge 'v1.4.3' into master
Release v1.4.3
This commit is contained in:
commit
8719f2836e
18 changed files with 717 additions and 145 deletions
14
vendor/github.com/NYTimes/gziphandler/gzip.go
generated
vendored
14
vendor/github.com/NYTimes/gziphandler/gzip.go
generated
vendored
|
@ -150,7 +150,9 @@ func (w *GzipResponseWriter) startGzip() error {
|
|||
|
||||
// WriteHeader just saves the response code until close or GZIP effective writes.
|
||||
func (w *GzipResponseWriter) WriteHeader(code int) {
|
||||
w.code = code
|
||||
if w.code == 0 {
|
||||
w.code = code
|
||||
}
|
||||
}
|
||||
|
||||
// init graps a new gzip writer from the gzipWriterPool and writes the correct
|
||||
|
@ -190,10 +192,16 @@ func (w *GzipResponseWriter) Close() error {
|
|||
// http.ResponseWriter if it is an http.Flusher. This makes GzipResponseWriter
|
||||
// an http.Flusher.
|
||||
func (w *GzipResponseWriter) Flush() {
|
||||
if w.gw != nil {
|
||||
w.gw.Flush()
|
||||
if w.gw == nil {
|
||||
// Only flush once startGzip has been called.
|
||||
//
|
||||
// Flush is thus a no-op until the written body
|
||||
// exceeds minSize.
|
||||
return
|
||||
}
|
||||
|
||||
w.gw.Flush()
|
||||
|
||||
if fw, ok := w.ResponseWriter.(http.Flusher); ok {
|
||||
fw.Flush()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue