Skip to content

Commit be7a9b9

Browse files
author
Laurie Clark-Michalek
committed
Stop double flushing
1 parent 328eeba commit be7a9b9

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Diff for: middleware/compress.go

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ func (h *httpGenericWrapper) CloseNotify() <-chan bool {
227227
func (h *httpGenericWrapper) Flush() {
228228
if f, ok := h.genericWrapper.inner.(http.Flusher); ok {
229229
f.Flush()
230+
return
230231
}
231232

232233
h.genericWrapper.inner.Unwrap().(http.Flusher).Flush()

Diff for: middleware/compress_18.go

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func (h *http2GenericWrapper) CloseNotify() <-chan bool {
3939
func (h *http2GenericWrapper) Flush() {
4040
if f, ok := h.genericWrapper.inner.(http.Flusher); ok {
4141
f.Flush()
42+
return
4243
}
4344

4445
h.genericWrapper.inner.Unwrap().(http.Flusher).Flush()

0 commit comments

Comments
 (0)