Skip to content

Commit 06b9214

Browse files
committed
feat(middleware): Make logging http writer SSE compatible
1 parent 726d66b commit 06b9214

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/middleware/logger.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ func (lrw *loggingResponseWriter) WriteHeader(code int) {
124124
lrw.ResponseWriter.WriteHeader(code)
125125
}
126126

127+
func (lrw *loggingResponseWriter) Flush() {
128+
if f, ok := lrw.ResponseWriter.(http.Flusher); ok {
129+
f.Flush()
130+
}
131+
}
132+
127133
func newLoggingResponseWriter(w http.ResponseWriter) *loggingResponseWriter {
128134
// WriteHeader(int) is not called if our response implicitly returns 200 OK, so
129135
// we default to that status code.

0 commit comments

Comments
 (0)