From 1a658ede0389b10433cfb2e0795dbd2cfef1c6e7 Mon Sep 17 00:00:00 2001 From: jpinner-lyft Date: Sat, 5 Aug 2017 18:53:44 -0700 Subject: [PATCH] stat response writer should support Flusher interface (#16) --- stat_handler.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stat_handler.go b/stat_handler.go index 421856c..3dd7bd0 100644 --- a/stat_handler.go +++ b/stat_handler.go @@ -45,3 +45,9 @@ func (h *statResponseWriter) WriteHeader(code int) { h.handler.scope.NewCounter(strconv.Itoa(code)).Inc() h.delegate.WriteHeader(code) } + +func (h *statResponseWriter) Flush() { + if flusher, ok := h.delegate.(http.Flusher); ok { + flusher.Flush() + } +}